I have an update panel, a modalpopup extender & a gridview. The Gridview is inside the modalpop on a panel & has a checkbox for each record whose checked status i want to retrieve using javascript. (Im actually doing a validation where a user has to select atleast 1 record from the Grid View or else an alert message will be displayed when the OK button is clicked).
Here is the sample javascript code:
function fnValidateAdd()
{
var gvET = document.getElementById("ctl00_ContentPlaceHolder1_grvProof");
var rCount = gvET.rows.length;
var rowIdx = 1;
for (rowIdx; rowIdx <= rCount - 1; rowIdx++)
{
var rowElement = gvET.rows[rowIdx];
var chkBox = rowElement.cells[1].firstChild;
if (chkBox.checked)
{
return true;
}
}
alert('Select a Proof');
return false;
}
The problem im facing is that "chkBox.checked" always returns false for every row, even if i have checked all the records.
Has anyone encountered a similar problem?