Skip to content

Commit

Permalink
Merge pull request #3 from passioneight/form-submission-fix
Browse files Browse the repository at this point in the history
fix: check if the form needs to be submitted
  • Loading branch information
passioneight committed Mar 10, 2022
2 parents 7b2070f + 7e3f6f7 commit 91caece
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Resources/public/js/recaptcha.js
Expand Up @@ -34,7 +34,13 @@ googleRecaptchaScript.addEventListener('load', function() {

element.value = token;

form.dispatchEvent(new Event('submit'));
var doSubmit = form.dispatchEvent(new Event('submit', {
cancelable: true
}));

if(doSubmit) {
form.submit();
}
});
});
}
Expand Down

0 comments on commit 91caece

Please sign in to comment.