Goal: Stop 'submit' button, validate field, create popover alerting of results, submit form when popover is closed.
So I have a hidden popover div, and when the submit button is pressed I do this to check for certain conditions AND display the popover:
$("form").submit(function(e) {
e.preventDefault();
if (($("#conditions").find("input:checkbox:checked").length ) || $('#radio_condition_1').is(":checked")) {
$("#popback").css('display', 'block');
}
});
Then I THOUGHT this code would submit the form once the popover is cleared:
$("#popback").click(function() {
$("#popback").css('display', 'none');
$("form").submit();
});
without:
$("form").submit();
The second code works fine to clear the popover. However, with the submit function inserted it not only doesn't clear the popover, it also doesn't submit the form.
NOTE: there are two forms on the page.
Help?