<form action="" method="post" name="form1">
<script type="text/javascript">
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll"&&e.disabled!=true)
e.checked = form.chkAll.checked;
}
}
</script>
<input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">选中/取消所有
<p><input name="checkbox[]" type="checkbox" value="checkbox1"> checkbox1
<p><input name="checkbox[]" type="checkbox" value="checkbox2"> checkbox2
<p><input name="checkbox[]" type="checkbox" value="checkbox3"> checkbox3
<p><input name="checkbox[]" type="checkbox" value="checkbox4"> checkbox4
<p><input name="submit" type="submit" value="提交">
</form>