checkbox有checked属性
formname.checkboxname.checked=true/false(选中/未选中)disable也一样
formname.objname.disabled=false(前提是改obj要有disabled属性)
formname.checkboxname.checked=true/false(选中/未选中)disable也一样
formname.objname.disabled=false(前提是改obj要有disabled属性)
调试欢乐多
直接将ENABLE就可以了
<input type="checkbox" name="a" value="1">
<input type="checkbox" name="a" value="2" onclick="">
<input type="checkbox" name="a" value="3">
<input type="button" onclick="checkForm(this.form)" value="check">
<input type="button" onclick="this.form('a')[0].disabled=!this.form('a')[0].disabled" value="disable">
</form>
<script language="JavaScript">
<!--
function checkForm(theForm){
for(i=0;i<theForm("a").length;i++){
if(theForm("a")[i].checked){
alert("value"+theForm("a")[i].value+" checked")
}
}
}
//-->
</script>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script>
<!--
function ischeck(theForm)
{
if (theForm("a").checked) {
alert("Checked!");
} else {
alert("Not checked!");
}
}
//-->
</script>
</HEAD><BODY>
<form>
<input type="checkbox" name="a" onchange="ischeck(this.form)"> hello
</form>
</script></BODY>
</HTML>