如何在我的HTML表單中啓用提交按鈕並禁用複選框未選中狀態?如果複選框被選中/取消選中,啓用/禁用提交按鈕?
這段代碼有什麼問題?
EnableSubmit = function(val)
{
var sbmt = document.getElementById("Accept");
if (val.checked == true)
{
sbmt.disabled = false;
}
else
{
sbmt.disabled = true;
}
}
複選框
<td width="30%">Do you accept Terms of Service agreement?</td>
<td width="10px" style="min-width: 10px"></td>
<td width="70%">
<input type="checkbox" name="TOS" value="Accept" onClick="EnableSubmit"> I agree to Terms of Service agreement.
</td>
的可能重複[如何禁用提交按鈕時複選框取消選中?(http://stackoverflow.com/questions/5458531/how- do-i-disable-a-submit-button-when-checkbox-is-uncheck) – 2014-07-06 10:59:53