Please help with Radio buttons

  • Thread starter Thread starter momo
  • Start date Start date
M

momo

Hello all,

I need some help with radio buttons. This is what I have. I have 15 groups
of radio buttons and each group contains three radio buttons which non of
them are selected.

I need a way to see which button in each group was selected. All these radio
buttons are optional, meaning it doesn't have to be selected but if any was
then I need to find out which one did. Please help.


Thanks,

Momo
 
If you are using <input type=radio ...> elements, then the only way to
determine which is checked is to iterate through every single
HtmlInputRadioButton on the page and interrogate the checked property.
However, you could use the <asp:RadioButtonList ...> object, and test the
SelectedItem group of the list for its value (null if none selected) to save
yourself some code. I'm not sure, but I think that's a new web control for
the 1.1 framework, in case you are still using 1.0.
 
Back
Top