Check All Checkboxes

[Total: 0    Average: 0/5]

Want to check all your check boxes with one action?

Body Code:

<SCRIPT language=JavaScript><!-- Hide script

function doCheckAll()
{
  with (document.dam) {
    for (var i=0; i < elements.length; i++) {
        if (elements[i].type == 'checkbox' && elements[i].name == 'SB')
           elements[i].checked = true;
    }
  }
}

// End script hiding --></SCRIPT>
<FORM  name=dam>
&nbsp;&nbsp;<INPUT name=SB type=checkbox value=1> 
<INPUT name=SB type=checkbox value=2> 
<INPUT name=SB type=checkbox value=3> <br>
&nbsp;&nbsp;<INPUT name=SB type=checkbox value=4> 
<INPUT name=SB type=checkbox value=5> 
<INPUT name=SB type=checkbox value=6> <br>
&nbsp;&nbsp;<INPUT name=SB type=checkbox value=7> 
<INPUT name=SB type=checkbox value=8> 
<INPUT name=SB type=checkbox value=9> <br>
<INPUT onclick=doCheckAll() type=button value="Check all">
<INPUT type=reset value="Reset">
</FORM >

Times Viewed: 0

Leave a Reply

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