-
Notifications
You must be signed in to change notification settings - Fork 10
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
A built-in way to intercept a missing reCAPTCHA error? #135
Comments
When might the reCATCHA not be checked client-side? When JS is disabled, maybe? For that case, a simple |
The main scenario I suggest this for is when the user forgot to check the reCAPTCHA. For example, let's say I have a long form and my first field is invalid. I scroll up to fix it and hit enter to validate the form. If the reCAPTCHA is off-screen, the error message that says my field is invalid is still there, but the actual problem is the reCAPTCHA that has been unchecked. It can be confusing, especially if I'm focused on the field itself. I'm not sure if that's clear, I can make an example if needed. |
Thanks, @jogarijo. An example might help. I don't know that this is something we will be able to make time for, but we'd be happy to review a PR. |
Will probably be opening one during the weekend then. 🙂 |
@abea Looks like this issue can be closed. |
@scabralo I'm not with the core team anymore, so I'll leave it to one of them to close this and merge the other. |
Bea just wants us to miss him more. (It's working!) |
The problem to solve
While using an Apostrophe Forms with reCAPTCHA enabled, I want to enact specific actions when the reCAPTCHA is not checked on client-side.
Currently, it's not possible without watching for DOM mutations on the reCAPTCHA error message block or having a custom
submit
event that replicates the logic (cf lib/modules/apostrophe-forms-widgets/public/js/lean.js:50-53).Proposed solution
Just like there are custom events triggered when the form is submitted (
apostrophe-forms:submission-form
on success,apostrophe-forms:submission-failed
on error), there could be a similar event, likeapostrophe-forms:submission-missing-recaptcha
or something appropriately named.Alternatives
Another possible solution would be to not check reCAPTCHA presence at all on client-side, and let the server send back an appropriate error. The missing reCAPTCHA event would thus be embedded just as another invalid field in the
apostrophe-forms:submission-failed
event.The text was updated successfully, but these errors were encountered: