Select All Checkboxes in GridView using JavaScript

Rajni.Shekhar
Posted by Rajni.Shekhar under JavaScript category on | Points: 40 | Views : 2046
//check all check boxes
function CheckAllCheckBox(grid, aspCheckBoxID, checkVal) {
var gridView = document.getElementById(grid);
for (i = 1; i < gridView.rows.length; i++) {
var inputs = gridView.rows[i].getElementsByTagName('input');
if (inputs != null && inputs.length != 0) {
inputs[0].checked = checkVal;
}
}
}

Comments or Responses

Login to post response