0
我有一個網格視圖,我想查看是否選中了第一列中的複選框。如果複選框被選中,它將打開一個新窗口。我無法弄清楚如何查看複選框是否被選中。請幫助下面的功能不工作,我不明白爲什麼。檢查是否在使用Javascript的GridView的一行中檢查了asp複選框
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);
}