I have a form with radio buttons in them. I loop through the radio button groups to determine if they are all checked. If not, I am not submitting the form, otherwise submit the form.
The issue is when it fails the first time, going back and selecting all radios, resubmitting doesnt submit the form. Although I added alerts in there, it is hitting the submit part but not actually submitting.
$('#submit-fee').click(function(){
var bValid = false;
$('input[type="radio"]').each(function(index) {
if($('input[name="'+$(this).attr('name')+'"]:checked').val() == "YES" || $('input[name="'+$(this).attr('name')+'"]:checked').val() == "NO"){
bValid = true;
}else{
bValid = false;
return false;
}
});
if(!bValid){
alert("Please make sure all questions are answered.");
$('#rec-fee-form').submit(function () {
return false;
});
}else{
return true;
}
});