How to Trigger Validation on Page Load with conform-to/react and zod? #844
Answered
by
Pouet--
KokiKubota2
asked this question in
Q&A
-
I'm using conform-to/react and zod for validation in my React application. Is it possible to trigger validation when the page initially renders? Currently, even if the default values violate the validation rules, form.valid still returns true. How can I ensure that the form reflects the validation errors and sets form.valid to false on initial render? Any guidance would be appreciated! |
Beta Was this translation helpful? Give feedback.
Answered by
Pouet--
Jan 9, 2025
Replies: 1 comment 3 replies
-
Did you try with |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
KokiKubota2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you try with
form.validate()
(and maybeform.reset()
) methods, to manually trigger the validation ?