Hey there! I'm currently working on a gridview that includes a checkbox column. While I can easily determine whether a row is checked, I'm facing an issue trying to obtain the cell value using JavaScript. The reason behind my use of JS is due to the necessity of making an ajax call once I retrieve the cell value. Any help or insights would be greatly appreciated! Below is the code snippet:
function newData(mode) {
if (mode == 'edit') {
var valid = false;
var gv = document.getElementById("myGridview");
for (var i = 0; i < gv.all.length; i++) {
var node = gv.all[i];
if (node != null && node.type == "checkbox" && node.checked) {
valid = true;
break;
}
}
if (!valid) {
alert("Invalid. Please select a checkbox to continue.");
}
return valid;
}
}