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

Validate field by validationFields if there is only form-level validation #234

Closed
ivansky opened this issue Jul 16, 2019 · 1 comment
Closed

Comments

@ivansky
Copy link
Contributor

ivansky commented Jul 16, 2019

It might be related to issue #185

Problem:
There are might be related fields that should be validated along, e.g. password and repeat password fields.
And a message for the touched field has to be shown right after the field input.

Idea:
Validate touched field by calling validateFields function to retrieve an error if it has validateOnChange or validateOnBlur property.

Live example of problem:
https://codesandbox.io/s/validate-on-change-but-form-level-validation-r4tg4

The same example with Formik
https://codesandbox.io/s/formik-form-level-validation-onchange-example-l3568

@joepuzzo
Copy link
Collaborator

I should have been more clear in docs that validateFields only occurs when form submits

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

2 participants