I have 2 checkboxes in a GridView. I want to validate them with JavaScript. This is my aspx code...
MyGridView = document.getElementById('<%= this.MyGridView.ClientID %>');
var Inputs = MyGridView.getElementsByTagName("input");
var chkBox = "chkExists";
for(var n = 0; n < Inputs.length; ++n)
if(Inputs[n].type == 'checkbox' &&
Inputs[n].id.indexOf(chkBox,0) >= 0 &&
Inputs[n].checked)
return true;
Similarly you can check for the other checkbox too...