Skip to content

Commit 2cef879

Browse files
Captcha: multiclick event handler prevented captcha event handler from being executed
1 parent b81bcd5 commit 2cef879

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Smartstore.Web/wwwroot/js/smartstore.globalinit.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,18 @@ jQuery(function () {
8080
});
8181

8282
// Prevent (button) multiclick
83-
$(document).on('click', '.btn-prevent-multiclick', function () {
83+
$(document).on('click', '.btn-prevent-multiclick', function (e) {
8484
let el = $(this);
8585
let containingForm = el.closest("form");
8686

8787
if (containingForm.length) {
8888
el.prop('disabled', true);
89-
containingForm.trigger('submit');
89+
90+
const submitEvent = new Event('submit', {
91+
bubbles: true,
92+
cancelable: true
93+
});
94+
containingForm[0].dispatchEvent(submitEvent);
9095

9196
if (!containingForm.valid()) {
9297
el.prop('disabled', false);

0 commit comments

Comments
 (0)