I made jQuery BlockUI Plugin to be triggered on every form submit action:
$("form").submit(function() {
jQuery.blockUI();
});
I want to validate some of the forms before they are submitted:
<form method="POST" onSubmit="return(confirm('Really submit?'));">
When I hit "Cancel" on the confirm popup box, the BlockUI gets triggered and blocks the interface. It never gets unblocked.
Here's an example: http://jsfiddle.net/8B8yA/.
The question is how to prevent BlockUI from getting triggered when "Cancel" is pressed.
I've tried adding $.unblockUI() to "Cancel" action:
if(!confirm("Really submit?")) {
$.unblockUI();
return(false);
}
but it obviously does not work, as the unblock action is called before the block action is.
How about:
and
See: http://jsfiddle.net/8B8yA/5/