DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Javascript Tp Check/uncheck The Header Check Box On Chile Check Boxes Check/uncheck
// Javascript tp check/uncheck the header check box on chile check boxes check/uncheck
function CheckChanged(headerCheckBox, childCheckBox) {
var frm = document.forms[0];
var allChildChecked;
allChildChecked= true;
for (i = 0; i < frm.length; i++) {
e = frm.elements[i];
if (e.type == 'checkbox' && e.name.indexOf(childCheckBox) != -1) {
if (e.checked == false) {
allChildChecked= false;
break;
}
}
}
for (i = 0; i < frm.length; i++) {
e = frm.elements[i];
if (e.type == 'checkbox' && e.name.indexOf(headerCheckBox) != -1) {
if (boolAllChecked == false)
e.checked = false;
else
e.checked = true;
break;
}
}
}





