RadioButtons, get checked buttons and using GroupName property.

S

Solveig Osk

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 ?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top