Skip to content

Question - trigger validation on submit #143

@IrvingArmenta

Description

@IrvingArmenta

Is there a way to trigger validation for all inputs on "Submit" ? something like formState.validateFields() or something.

I don't want to use the HTML5 api for form validation at all (<form noValidate={true} />) , therefore when the user clicks "submit" I want the fields that are required to show the error message that they're required. This is how react-hook-formand other frameworks work.

I understand I can "disable" the submit button with the Pristine() function, but I don't want to disable this button, also, if there is a field input that needs to have the same value as other input (password confirmation or email confirmation) the user can just click "submit" either way, since Pristine() just throws false at this point.

Is there a work around for this functionality?

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