不能通过check的状态改变按钮是否可用
<script type="text/javascript">function sub() {
alert("dfd");
if (document.vForm.after.checked) {
document.vForm.inputSubmit.disabled = disabled;
} else {
document.vForm.inputSubmit.disabled=false;
}
}
</script> --------------------编程问答-------------------- 楼主这个问题,当时在学校的时候也遇到过,现在不知道该怎么改了 --------------------编程问答--------------------
--------------------编程问答--------------------
<html>
<head>
<script type="text/javascript">
function sub()
{
if (document.getElementById("marry").checked)
{
document.getElementById("marry").disabled = "";
}
else
{
document.getElementById("marry").disabled = "disabled";
}
document.forms["myForm"].submit();
}
</script>
</head>
<body>
<form action="abc.html" id="myForm">
婚否:<input type="checkbox" id="marry" value="true"/>
<input type="button" onclick="sub()"/>
</form>
</body>
</html>
<script type="text/javascript">
function show(){
var ckk = document.getElementById("ck");
if(ckk.checked){
document.form1.bt.disabled = true;
}else{
document.form1.bt.disabled = false;
}
}
</script>
</head>
<body>
<form name=form1>
<input type="checkbox" id="ck" onclick="show()">
<input type="button" name="bt" value="xx xx">
</form>
补充:Java , Java EE