Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding invisiblerecaptcha breaks client-side validation via parsley on submit #3

Open
neufeind opened this issue Mar 30, 2018 · 2 comments

Comments

@neufeind
Copy link

The normal parsley-validation during input like "must be a valid email-address" still works. But the submit-validation of parsley which prevents submission of the form is required fields are missing doesn't work for me once invisiblerecaptcha is installed. It seems the validation is triggered, but even if it fails the captcha-validation kicks in, verifies the captcha is fine and submits the form. Missing required-fields are then only detected by the server-side validation of powermail 5.x.

@cweiske
Copy link

cweiske commented Jul 2, 2018

Standard HTML5 validation is also broken (<input required>).

@griesi007
Copy link

griesi007 commented Feb 13, 2020

To make html5 & parsley validation work you could replace the default button in Invisiblerecaptcha.html with the following.
<div class="g-recaptcha" data-sitekey="{settings.invisiblerecaptcha.sitekey}" data-size="invisible"> </div>
You need to add another regular submit button to the form. This submit button will trigger regular form submission so recaptcha must be triggered on form submit manually:
jQuery('form.powermail_form').submit(function(){ if(typeof(grecaptcha) === 'object'){ grecaptcha.execute(); } });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants