antiflag:
i have three radio buttons....and a search button....atleast one of them should be checked for any search to go on....
can required filled validator be used so that atleast one of the radio buttons should be clicked inorder to search something or else it will show a pop up message....
Hi,
Based on my understanding, you need to make the user at least select one item from the radio buttons group. If so, you can easily achieve this task by using a RadioButtonList and a RequiredFieldValidator.
I made a simple instance for you here. Please follow it and let me know if it works.
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem>Item1</asp:ListItem>
<asp:ListItem>Item2</asp:ListItem>
<asp:ListItem>Item3</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="You need to select at least one item from the radio group"
ControlToValidate="RadioButtonList1">
</asp:RequiredFieldValidator>
<p />
<asp:Button ID="Button1" runat="server" Text="Submit" />
Best Regards,
Shengqing Yang
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread : )