Closed hatefk closed 4 years ago
There is nothing such as warning in formik. But what you can do to achieve this is by writing a custom validation function/schema to check for these conditions and show warning/error on the Input Field. While just adding the error conditions/validation to the formik form, which is A > 10 or A < 0
in your case
Thanks @maddhruv
This is a long shot but Im wondering if there is a way to implement multi level validation warnings/errors via Yup and Formik?
For example lets say for value A possible values are 0-10. I want to implement the following validation schema:
"A > 10 or A< 0" --> Raise Error and do not let user submit "A > 8 or A< 2" --> Raise a Warning (Value is too high or too low) but let user submit "A > 6 or A< 4" --> Raise a Warning (Value is a little bit high ) but let user submit "A = 5" --> No error or message, just let the user submit.