I am using VS 2005.
In my ASP.NET page, I wrote a CustomValidator that calls a ClientSide Javascript function.
How do I loop through my GridView checking to make sure at least one checkbox has been checked?
Here is some code:
In my ASP.NET page, I wrote a CustomValidator that calls a ClientSide Javascript function.
How do I loop through my GridView checking to make sure at least one checkbox has been checked?
Here is some code:
Code:
<asp:GridView ID="GridView1" ...
<asp:CustomValidator ID="CVGridView1"
OnServerValidate="CVGridView1_ServerValidate"
ClientValidationFunction="CVGridView1_ClientValidate"
SetFocusOnError="true"
Text="*"
runat="server"
ErrorMessage="Distribution Type must be selected" />
function CVGridView1_ClientValidate()
{
//How to loop through GridView and check if at least one checkbox has been checked
}