jscript - Uncheck a group of radio buttons with Javascript -
i have 2 groups of radio buttons. when button in on group clicked button in other group should unchecked, , vice versa.
the smartest way thought onclick. can't head around it. suggestions?
[radio button 1 name="a"] [radio button 2 name="a"] [radio button 3 name="a"] [radio button 1 name="b"] [radio button 2 name="b"] [radio button 3 name="b"]
thanks ray
try this:-
function disableradiobtnset(){ if ($('[name="a"]').is(':checked')){ $('input[name="b"]').attr("disabled",true); }else{ $('input[name="a"]').attr("disabled",true); } } $("input[name='a']").change(function(){ disableradiobtnset(); }); $("input[name='b']").change(function(){ disableradiobtnset(); });
Comments
Post a Comment