Aaron
Aaron

Reputation: 4480

Several radio buttons selected at same time

I have several dynamically created rows that have radio buttons in them. Every time I click on one radio button it sets all the other radio buttons to false. Is there a way so only one radio button becomes false and not the rest of the radio buttons?

Upvotes: 0

Views: 883

Answers (2)

HaveDanson
HaveDanson

Reputation: 26

You probably need to group your radio buttons by name

Example:

<input type='radio' name="group1" /> 
<input type='radio' name="group1" /> 
<input type='radio' name="group1" />

<input type='radio' name="group2" /> 
<input type='radio' name="group2" /> 
<input type='radio' name="group2" />  

If you click a radio button in group2 it shouldn't affect group1.

Upvotes: 1

JVincent
JVincent

Reputation: 36

Do you own the code generating the dynamically created rows? The functionality you're aiming for is indicative of check boxes rather than radio buttons.

Upvotes: 2

Related Questions