From feb45bc27dfb33261f81f53e9d04da3451326ead Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Thu, 21 Sep 2017 11:40:28 +0200 Subject: [PATCH] SUPPORT-1227: Fixed prevention of multiple submits of a form --- themes/loop/scripts/form.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/themes/loop/scripts/form.js b/themes/loop/scripts/form.js index 0ea62224..35311634 100644 --- a/themes/loop/scripts/form.js +++ b/themes/loop/scripts/form.js @@ -2,10 +2,8 @@ $(function () { // Disable all submit buttons on submit to prevent multiple // submits. - // Using the "submit" event on the form is too slow (late), so we - // use the "click" event on the button itself. - $('form [type="submit"]').on('click', function() { - $(this).closest('form').find('[type="submit"]').prop('disabled', true); + $('form').on('submit', function() { + $(this).find('[type="submit"]').prop('disabled', true); }); }); })(jQuery);