hai,
i want to select only parent checkbox. then automatically check all child checkboxes. i mean checkall checkboxes at once. using javascript
<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;
}
}
}
-->
</SCRIPT>
<BODY>
<FORM>
<INPUT TYPE=checkbox NAME="chkboxarray" VALUE="1"><br>
<INPUT TYPE=checkbox NAME="chkboxarray" VALUE="2"><br>
<INPUT TYPE=checkbox NAME="chkboxarray" VALUE="3"><br>
<INPUT TYPE=checkbox NAME="CheckAll" VALUE="Check All Boxes" onClick="modify_boxes(true,3)">check all
</FORM>
</BODY>
it does not working. anybody help plz.