我需要禁用此按鈕,並且當用戶選中複選框時,它需要啓用,它根本不適用於我,按鈕保持禁用狀態,我知道onclick正在調用腳本,因爲我把警報在腳本和它提醒我....當啓用JavaScript複選框時,啓用JavaScript按鈕
<script type="text/javascript">
function goFurther(){
if (document.getElementById("ID").checked == true)
document.getElementById("Calculate").disabled = false;
else
document.getElementById("Calculate").disabled = true;
}
</script>
<style type="text/css">
input[disabled]
{
color:Gray; text-decoration:none;
}
</style>
<CFOUTPUT query = "qGetOpenItemsTrans">
<TR>
<TD ALIGN = "CENTER">
<input type="checkbox" name = "chkbx" id='#ID#' value="#seq_claim_id#" onClick="goFurther()" unchecked = 0 >
</TD>
<TD ALIGN = "CENTER">#Inventory_Date#</TD>
<TD ALIGN = "CENTER">#seq_claim_id#</TD>
<TD ALIGN = "CENTER">#Month_Closed#</TD>
<TD ALIGN = "CENTER">#Amount_Rcvd_by_FRG#</TD>
<TD ALIGN = "CENTER">#Commission_Amt#</TD>
<TD ALIGN = "CENTER">#Net_Recovery#</TD>
</TR>
<INPUT TYPE ="Button" NAME = "Calculate" VALUE = "Calculate" onClick = "FormSubmit();" style="height:35px; width:150px; font-size:medium; font-weight:bold; color:green;" disabled >
可能重複(http://stackoverflow.com/questions/3858022/jquery-disabled-button-with-checkbox-issue) – 2014-10-08 18:06:57