Validating Checkbox and Radio Button in C#
- by Solution
Hi,
I am using c# for coding!
Below is my html for checkbox and radion button
<input type="radio" style="float: left;" name="documents" id="Checkbox9" value="yes"
runat="server" />
<label style="width: 35px!important;" class="checkbox">
<%=GetResourceString("c_HSGStudent")%>
</label>
<input type="radio" style="float: left;" name="documents" id="Checkbox10" value="no"
runat="server" />
<label style="width: 25px!important;" class="checkbox">
<%=GetResourceString("c_HSGParent")%>
</label>
<input type="radio" style="float: left;" cheked name="documents" id="Radio1" value="yes"
runat="server" />
<label style="width: 35px!important;" class="checkbox">
<%=GetResourceString("c_HSGStudent")%>
</label>
<input type="radio" style="float: left;" name="documents" id="Radio2" value="no"
runat="server" />
<label style="width: 25px!important;" class="checkbox">
<%=GetResourceString("c_HSGParent")%>
</label>
You can see I have two checkboxes and two radio buttons, My problem is that on my submit button click I want to check whether user have checked at-least one checkbox or radio button. It will be good if we can have .NET solution like (customvalidator).
Please suggest!
Thanks