Skip to content

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

@entobvba

Description

@entobvba

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions