Click here to Skip to main content
15,894,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to have required field validator for at least one radio button selected in a radio button group.

FYI - I am not looking for required field validator for radio button list.

Thanks,
Posted

Why do you need a validator control for radio button. Just make one radio button selected/checked in the group by default. If you don't want to do that than why not just write a simple javascript function to validate the radio buttons' state.
 
Share this answer
 
XML
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
        </asp:RadioButtonList>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="RadioButtonList1" runat="server" ErrorMessage="Select Item !"></asp:RequiredFieldValidator>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900