I have multiple forms each with a radiobutton group
Basically I want to only allow the user to select one of the options once.
In my case only allow selection of Yes once
You can see the behaviour in the link below
- select Yes option on first row (remains at NO – what i want)
- select No option on second row
- select Yes option on first row (allowed because no other YES selected)
- select Yes option for second row (switches selection to NO on first row instead of remaining at NO)
Seems to ignore the selection in this line of the jquery code
$(‘input:radio[name=$(tmp)]]’)[1].checked = true;
You could do something like this :
Fiddle here: http://jsfiddle.net/6EQHE/5/