Posted by mannerboy on 10/15/52 11:39
here is a simple example,wish it can be helpful! :)
<script>
function CheckAll(form){
for(var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.name == 'id[]'){
e.checked = form.chkall.checked;
}
}
}
</script>
<form name="test" method="post" >
<input name="chkall" type="checkbox"
onclick="CheckAll(this.form);">Select All
<input type="checkbox" name="id[]" value="1000">Joe Schmoe<br />
<input type="checkbox" name="id[]" value="1001" checked="checked"><br
/>
<input type="checkbox" name="id[]" value="1002">Jane Johnson<br />
<input type="checkbox" name="id[]" value="1003">Charlie Brown<br />
</form>
[Back to original message]
|