We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to add validation if a particular field exists in the form, otherwise, there should not be any validation or skip validation for that field.
How can I achieve this?
The text was updated successfully, but these errors were encountered:
use object({}).test()
object({}).test()
Sorry, something went wrong.
You can also use when. For example, add a required validation on foo if bar is present :
foo
bar
foo: mixed().when("bar", { is: value => !!value, then: mixed().required() }),
so what i just did
<Formik onSubmit={actualSubmitFunction} . .
<button onClick={vales.valueExists? submitForm(): actualSubmitFunction(values)}>submit </button>
No branches or pull requests
I want to add validation if a particular field exists in the form, otherwise, there should not be any validation or skip validation for that field.
How can I achieve this?
The text was updated successfully, but these errors were encountered: