Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply groupname to HTML radio buttons in asp.net?

Can anyone please tell about how to apply group name to html (input) radio button controls so that i can select any one of the available radio buttons?

I have input radios in a table. Each row contains two radios as follows. I want to select one from each row. But i am able to select only one radio button amongst all radio buttons present on all rows.

<input name="radiobutton" type="radio" value="radiobutton" />Option1
<input name="radiobutton" type="radio" value="radiobutton" />Option2

What change i have to make to select one radio button on each row?

Thanks, ~kaps

like image 719
Jaqen H'ghar Avatar asked Jan 19 '10 06:01

Jaqen H'ghar


1 Answers

As far as I know, radiobuttons in HTML do not have group names. Their HTML "name" attribute is the group name.

It is important to verify that each radiobutton has a unique "value" attribute. Otherwise there is no way to tell which of the duplicate values was selected:

<input name="radiobutton" type="radio" value="radiobutton1" />Option1 
<input name="radiobutton" type="radio" value="radiobutton2" />Option2 
like image 127
Eilon Avatar answered Oct 20 '22 11:10

Eilon