RadioButtons, get checked buttons and using GroupName property.

Discussion in 'ASP .Net Web Controls' started by Solveig Osk, Aug 12, 2003.

  1. Solveig Osk

    Solveig Osk Guest

    back in the "old days" I used to make radio buttons like so
    <input type="radio" name="GroupName" value="0">
    <input type="radio" name="GroupName" value="1">
    <input type="radio" name="GroupName" value="2">

    And then when I posted my form I could just check the
    value of the variable "GroupName" to see which button was
    checked.

    Now I am generating a list of radio buttons, and for each
    row I would like to know which radiobutton was checked in
    that row. Each row is like this:
    <asp:RadioButton runat="server" ID="A1"
    GroupName="GroupA"/>
    <asp:RadioButton runat="server" ID="A2"
    GroupName="GroupA"/>
    <asp:RadioButton runat="server" ID="A3"
    GroupName="GroupA"/>

    When I submit my form I would like to somehow find my
    RadioButton groups and check which value was selected in
    each group. Is this not possible anymore? Because I can't
    see no way of setting a "value" to the radio buttons. I
    also tried using a RadioButtonGroup but using that I
    always have to have some "display value" (my buttons are
    not supposed to have any text, just belong to a group and
    have a value).

    What would you advise me to do ? I think it will be to
    heavy to scrool through all the radio buttons and check if
    they are "checked" and then check what GroupName is set...
    and blah blah... Isn't there any more simple way ?
     
    Solveig Osk, Aug 12, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rishi Chandra

    Radio Button and groupName bug in ASP.NET

    Rishi Chandra, Dec 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    664
    Rishi Chandra
    Dec 22, 2003
  2. yurps
    Replies:
    1
    Views:
    6,994
    rajeshthangarasu1983
    Feb 29, 2008
  3. =?Utf-8?B?dmlzdWFsMjAwNWJldGFfZGV2ZWxvcGVy?=

    Groupname for Radiobutton kills Listener from Buttons?

    =?Utf-8?B?dmlzdWFsMjAwNWJldGFfZGV2ZWxvcGVy?=, Aug 30, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    523
    =?Utf-8?B?dmlzdWFsMjAwNWJldGFfZGV2ZWxvcGVy?=
    Sep 2, 2005
  4. WO70

    Radiobutton Groupname Property

    WO70, Nov 4, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    706
  5. Shadow Lynx
    Replies:
    0
    Views:
    653
    Shadow Lynx
    Jul 31, 2006
Loading...

Share This Page