React-Hook-Form. Diffrent validation on diffrent events #11600
Unanswered
Gray-Starling
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have just started using React Hook Form and I can't figure out how to implement different validation for different events.
So, i have an input
I want the "required" rule to trigger only on the "onSubmit" event and not on any other event. And all other rules, no matter what I specify, should trigger on the "onBlur" event.
I specified the onBlur mode in the useFome options for this.
But in this case, if I focus on the input and then remove it, the required rule will still work.
I tried this options.
But the options isSubmitted and isSubmitting are triggered only after validation.
Please tell me what I need to do to implement validation logic on different events. 🤔
Beta Was this translation helpful? Give feedback.
All reactions