Last active
December 18, 2015 17:59
-
-
Save danielgreen/5823028 to your computer and use it in GitHub Desktop.
An unobtrusive way to block the page on form submission. Requires jQuery Validation to be active on the form (either directly or via unobtrusive validation), and the submithandlerfix to be applied (https://gist.github.com/danielgreen/5669244). If jQuery Validation is not active on the form then we need another solution e.g. just bind to onsubmit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("form[data-block-page-on-submit]").each(function () { | |
$(this).validate().settings.submitHandler = function () { | |
window.BlockPage(); | |
return true; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment