I have a grid view and I want to see if the checkbox in the first column is checked. If the check box is checked it opens a new window. I cannot figure out how to see if the checkbox is checked. Please help the function below is not working and I can't figure out why.
function mapSelectedClick()
{
var CustomerIDs = "";
var grid = document.getElementById('<%=grdCustomers.ClientID %>');
for (var i = 1; i < grid.rows.length; i++)
{
var Row = grid.rows[i];
var CustomerID = grid.rows[i].cells[1].innerText;
if (grid.rows[i].cell[0].type == "checkbox")
{
if (grid.rows[i].cell[0].childNodes[0].checked)
{
customerIDs += CustomerID.toString() + ',';
}
}
}
customerIDs = customerIDs.substring(0, customerIDs.length-1);
window.open("MapCustomers.aspx?CustomerIDs=" + customerIDs);
}