<head> <script language="JavaScript"> <!-- function modify_boxes(to_be_checked,total_boxes){ for ( i=0 ; i < total_boxes ; i++ ){ if (to_be_checked){ document.forms[0].chkboxarray[i].checked=true; } else{ document.forms[0].chkboxarray[i].checked=false; } } } function AllNone(totalBoxes) { var varChecked; if (document.forms[0].chkAllNone.checked==true) { varChecked = true; } else { varChecked = false; } for (i=0; i < totalBoxes; i++) { document.forms[0].chkboxarray[i].checked=varChecked; } } --> </script> </head> <form> <body> <INPUT TYPE="checkbox" NAME="chkAllNone" VALUE="CheckAllNone" onClick="AllNone(3)">All<br><br> <INPUT TYPE="checkbox" NAME="chkboxarray" VALUE="1">Checkbox1<br> <INPUT TYPE="checkbox" NAME="chkboxarray" VALUE="1">Checkbox2<br> <INPUT TYPE="checkbox" NAME="chkboxarray" VALUE="1">Checkbox3<br> <input type=button name=CheckAll value="Check All Boxes" onClick="modify_boxes(true,3)"> <input type=button name=UnCheckAll value="UnCheck All Boxes" onClick="modify_boxes(false,3)"> </body> </form>