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

[Question|Issue] Bundle not triggering frontend validation #300

Open
entobvba opened this issue Mar 28, 2023 · 0 comments
Open

[Question|Issue] Bundle not triggering frontend validation #300

entobvba opened this issue Mar 28, 2023 · 0 comments

Comments

@entobvba
Copy link

entobvba commented Mar 28, 2023

Hi,

thanks for the bundle/code. Nice work and I use it a lot.

I'm having an issue where the frontend validation is not triggered.
I think the issue is that the javascript uses "submit" and not "requestSubmit" here:

https://github.com/excelwebzone/EWZRecaptchaBundle/blob/master/src/Resources/views/Form/v3/ewz_recaptcha_widget.html.twig

Not sure, so raising it as an question for now. When confirmed I can issue a PR.

See also:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit
https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit

The obvious question is: Why does this method exist, when we've had the submit method since the dawn of time?

The answer is simple. submit() submits the form, but that's all it does. 
requestSubmit(), on the other hand, acts as if a submit button were clicked. 
The form's content is validated, and the form is submitted only if validation succeeds. 
Once the form has been submitted, the submit event is sent back to the form object.
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

1 participant