I have a javascript link that I'm using as a button on a popup:
<a href="#" class="submit-action close-modal">Submit</a>
The "submit-action" class has a jQuery .click() binding that performs a .submit() on the form that's embedded inside the modal. The "close-modal" class has a .click() binding that closes the modal.
$(".submit-action").click(function() ($("#someForm").attr("action", "someURL");
$("#someForm").submit();
this.close = function () {
$("#modal").hide();
$.unblockUI();
};
$(".close-modal").click(function()(this.close);
Currently, when I click this button, the close-modal binding seems to be executing first and closing the modal before the form is submitted. So the popup closes without performing the submit. Is there a way I can force the "submit-action" binding to execute first without combining the two .click() bindings?