RadioButtons

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arulsoftura
    New Member
    • Sep 2007
    • 4

    #1

    RadioButtons

    I have a couple of RadioButtons both with the same GroupName.
    I can use a RequiredFieldVa lidator to ensure that at least one
    of the RadioButtons in the group is selected? Setting ControlToValida te
    to the GroupName doesn't work



    <asp:RadioButto n ID="rbMale" Text="Male" runat="server" GroupName="Gend er" />
    <asp:RadioButto n ID="rbFemale" Text="Female" runat="server" GroupName="Gend er" /> <br />
    <asp:RequiredFi eldValidator ID="RFVGender" runat="server" ControlToValida te="Gender" ErrorMessage="G ender Should not be Empt">
    </asp:RequiredFie ldValidator>
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    You can use <asp:RadioButto nList> for your purpose where you can add multiple radio buttons but you are allowed to select only one them


    Originally posted by arulsoftura
    I have a couple of RadioButtons both with the same GroupName.
    I can use a RequiredFieldVa lidator to ensure that at least one
    of the RadioButtons in the group is selected? Setting ControlToValida te
    to the GroupName doesn't work



    <asp:RadioButto n ID="rbMale" Text="Male" runat="server" GroupName="Gend er" />
    <asp:RadioButto n ID="rbFemale" Text="Female" runat="server" GroupName="Gend er" /> <br />
    <asp:RequiredFi eldValidator ID="RFVGender" runat="server" ControlToValida te="Gender" ErrorMessage="G ender Should not be Empt">
    </asp:RequiredFie ldValidator>

    Comment

    Working...