【发布时间】:2010-11-04 14:36:14
【问题描述】:
我有一个 javascript 函数,我正在尝试验证 gridview 的输入。我的问题是我无法获得单元格的值。这是我所拥有的:
function fcnCheck() {
var grid = document.getElementById("<%= GridViewProducts.ClientID %>");
var cellPivot;
if (grid.rows.length > 0) {
for (i = 1; i < grid.rows.length-1; i++) {
cellPivot = grid.rows[i].cells[0];
cellStatus = grid.rows[i].cells[1];
if (cellPivot == "Yes" and cellStatus == "") {
alert("You must select an answer for all columns if Pivot is yes")
return false;
}
}
}
}
这条线不起作用:cellPivot = grid.rows[i].cells[0];
【问题讨论】:
-
为什么不使用 CustomValidator?
标签: javascript asp.net gridview