Jquery Sync Selected Radio Button Between 2 Radio Button Groups
I know it can be done with input boxes using keyup paste on JQuery but what about Radio buttons? Example: User Selects option from Area A (radio button) and it selects(syncs) area
Solution 1:
$('input[name=radio_A]').change(function() {
var index = $(this).index('input[name=radio_A]');
$('input[name=radio_B]:eq(' + index + ')').attr('checked','checked');
});
Solution 2:
Try this:
$("#radio_A").click(function() {
$("#radio_B").attr("checked", $(this).attr("checked"));
});
$("#radio_A2").click(function() {
$("#radio_B2").attr("checked", $(this).attr("checked"));
});
Solution 3:
$("input[name='radioGroup1'][value='"+$("input[name='radioGroup2']:checked").val()+"']").prop("checked",true);
Post a Comment for "Jquery Sync Selected Radio Button Between 2 Radio Button Groups"