$(".dist_radio").click(function(event) {
event.preventDefault();
$(".dist_radio").removeClass('dist_on');
$(".dist_radio").children('input').attr('checked', false);
$(this).addClass('dist_on');
$(this).children('input').attr("checked", true);
});
is the way I'm handling custom styled radio buttons and everything is fine if I click on a single radio (#1
) and submit the form - it's being sent without errors (note that I'm having my form submit in a new window
), if I chose another radio button (#2
) and submit the form - again, the given radio is being sent with no issues, but if I then click back on the previously submitted radio button (#1
), I get a validation error that I haven't chosen any radio button even though by checking the element with firebug, I can see that it has checked="checked"
set.
Why is that and what can I do to fix it?