The Wayback Machine - https://web.archive.org/web/20201019213054/https://github.com/wsmd/react-use-form-state/issues/143
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 - trigger validation on submit #143

Open
IrvingArmenta opened this issue Oct 7, 2020 · 0 comments
Open

Question - trigger validation on submit #143

IrvingArmenta opened this issue Oct 7, 2020 · 0 comments

Comments

@IrvingArmenta
Copy link

@IrvingArmenta IrvingArmenta commented Oct 7, 2020

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?

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.