jquery prevent multiple selection of radiobutton -



jquery prevent multiple selection of radiobutton -

i have multiple forms each radiobutton grouping want allow user select 1 of options once. in case allow selection of yes once

you can see behaviour in link below

select yes alternative on first row (remains @ no - want) select no alternative on sec row select yes alternative on first row (allowed because no other yes selected) select yes alternative sec row (switches selection no on first row instead of remaining @ no)

seems ignore selection in line of jquery code

$('input:radio[name=$(tmp)]]')[1].checked = true;

running example

you :

$("input[name*='records']").click(function(e) { var inputs = $("form input[type=radio][value=y]:checked"); if (inputs.length > 1){ e.preventdefault(); } });

fiddle here: http://jsfiddle.net/6eqhe/5/

jquery

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -