Check to Check All Checkboxes

[Total: 0    Average: 0/5]

Checkboxes can be all checked, and all unchecked based upon checking a box.

Body Code:

<form name=f1>
<input type="checkbox" name="c1" value="1">c1-1<BR>
<input type="checkbox" name="c1" value="2">c1-2<BR>
<input type="checkbox" name="c1" value="3">c1-3<BR>
<input type="checkbox" name="c1" value="4">c1-4<BR>
<input type="checkbox" name="c1" value="5">c1-5<BR>
<input type="checkbox" name="c2" value="1">c2-1<BR>
<input type="checkbox" name="c2" value="2">c2-2<BR>
<input type="checkbox" name="c2" value="3">c2-3<BR>
<input type="checkbox" name="c2" value="4">c2-4<BR>
<input type="checkbox" name="c2" value="5">c2-5<BR>
<input type="checkbox" name="c3" value="false" onclick="doIt(this.value)">All Not Checked<BR>
<input type="checkbox" name="c4" value="true" onclick="doIt(this.value)">All Checked<BR>
function doIt(v)
 for(var i=0;i<document.f1.c1.length;i++)
 for(var i=0;i<document.f1.c2.length;i++)

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *