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

Snippets has posted 5883 posts at DZone. View Full User Profile

Javascript To Check All The Header Check Boxes Of Grid View

  • submit to reddit
        // Javascript to check all the header check boxes of grid view

function SelectAllGridCheckBoxes(checkBoxId) {
    var frmElements = document.forms[0];
    for (i = 0; i < frmElements .elements.length; i++) {
        if (frmElements .elements[i].type == "checkbox") {
            frmElements .elements[i].checked = checkBoxId.checked;
    return false;