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
Select/unselect All Checkboxes In Grid
// Select/unselect all checkboxes in grid
function SelectAllCheckBoxesInGrid(gridHeaderCheckBoxId, gridChildCheckBoxId) {
var frmElements = document.forms[0].getElementsByTagName('input');
for (i = 0; i < frmElements.length; i++) {
if (frmElements[i].type == "checkbox" && frmElements[i].id.indexOf(gridChildCheckBoxId, 0) >= 0) {
if (frmElements[i].disabled == false) {
frmElements[i].checked = gridHeaderCheckBoxId.checked;
}
}
}
return false;
}





