I've encountered an issue while trying to check all checkboxes within a gridview that contains approximately 2000 to 2500 records. The process takes a significant amount of time and in some cases, the page becomes unresponsive when attempting to click the "check all" checkbox.
If anyone has suggestions for improving this process, it would be greatly appreciated.
function checkAll(checkAllBox)
{
var chkBoxId;
chkBoxId = "chkSelect";
//alert(checkAllBox.value);
//alert(chkBoxId);
var chkState = checkAllBox.checked;
for(i=0;i<document.Form1.length;i++)
{
e = document.Form1.elements[i];
if(e.type == 'checkbox' && e.name.indexOf(chkBoxId) != -1)
{
checkAllBox.checked = chkState;
if(e.disabled == false)
{
e.checked=chkState;
}
}
else if(e.type == 'checkbox' && e.name.indexOf(chkBoxId) == -1)
{
if(chkState == true)
{
e.checked = false;
}
}
}
}