如何在我的 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>