<input type="radio" id="all" value="1" name="executeRadio" <s:if test="bankApointDateDayCondtion!=null">checked="checked"</s:if> >this
var redioCount = 0;
$(document).ready(function (){spa
if($("#all").attr("checked")=="checked") redioCount=1;
$("input[type='radio']").click(function(){
if(redioCount == 1){
$(this).removeAttr("checked");
redioCount=0;
}else {
$(this).attr("checked","checked");
redioCount=1;
}
});orm
})ci
實例:rem
<input type="radio" id="all" value="1" name="executeRadio" <s:if test="bankApointDateDayCondtion!=null">checked="checked"</s:if> > 每週指定日執行get
<table border="0" width="100%" align="center" cellpadding="2"
cellspacing="5" >
<tr>
<td><input type="checkbox" name="bankApointDateDayCondtions" <s:if test="withdrawConfig.bankApointDateDayCondtion==null">disabled="disabled"</s:if> ${withdrawConfig.isSun==1?"checked":""} value="1"></td>
<td><input type="checkbox" name="bankApointDateDayCondtions" <s:if test="withdrawConfig.bankApointDateDayCondtion==null">disabled="disabled"</s:if> ${withdrawConfig.isMon==1?"checked":""} value="2"></td>
<td><input type="checkbox" name="bankApointDateDayCondtions" <s:if test="withdrawConfig.bankApointDateDayCondtion==null">disabled="disabled"</s:if> ${withdrawConfig.isTue==1?"checked":""} value="3"></td>
<td><input type="checkbox" name="bankApointDateDayCondtions" <s:if test="withdrawConfig.bankApointDateDayCondtion==null">disabled="disabled"</s:if> ${withdrawConfig.isWed==1?"checked":""} value="4"></td>
<td><input type="checkbox" name="bankApointDateDayCondtions" <s:if test="withdrawConfig.bankApointDateDayCondtion==null">disabled="disabled"</s:if> ${withdrawConfig.isThur==1?"checked":""} value="5"></td>
<td><input type="checkbox" name="bankApointDateDayCondtions" <s:if test="withdrawConfig.bankApointDateDayCondtion==null">disabled="disabled"</s:if> ${withdrawConfig.isFri==1?"checked":""} value="6"></td>
<td><input type="checkbox" name="bankApointDateDayCondtions" <s:if test="withdrawConfig.bankApointDateDayCondtion==null">disabled="disabled"</s:if> ${withdrawConfig.isSat==1?"checked":""} value="7"></td>
</tr>
<tr>
<td>週日</td>
<td>週一</td>
<td>週二</td>
<td>週三</td>
<td>週四</td>
<td>週五</td>
<td>週六</td>
</tr>
</table>input
var redioCount = 0;
$(document).ready(function (){it
if($("#all").attr("checked")=="checked") redioCount=1;
$("input[type='radio']").click(function(){
if(redioCount == 1){
$(this).removeAttr("checked");
$("input[name='bankApointDateDayCondtions']").each(function(){
$(this).attr("disabled","disabled");
$(this).removeAttr("checked");
});
redioCount=0;
}else {
$(this).attr("checked","checked");
$("input[name='bankApointDateDayCondtions']").each(function(){
$(this).removeAttr("disabled");
});
redioCount=1;
}
});io
})table
function submitForm(){
if($("#all").attr("checked")!=undefined ){//勾選
var checkArry = document.getElementsByName("bankApointDateDayCondtions");
var isChecked=false;
for (var i = 0; i < checkArry.length; i++) {
if(checkArry[i].checked == true){
isChecked=true;
}
}
if(!isChecked){
alert("請選擇指定執行的日期!");
return false;
}
}
}