Why is on-blur validation occurring when submitting the form? #11885
Unanswered
malc-adams
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
-
Trying to achieve
I’m trying to create asynchronous validation, using react-hook-form, as I’m aiming to populate my forms with errors which come from the backend, not frontend.
I’ve put together an example of the issue I face, using:
Example: https://codesandbox.io/p/sandbox/react-hook-form-8rnkxg
Required functionality
Issue
The issue which I’m experiencing is that, after the first submission (on the second submission and onwards), it forces the text input to self-validate before submission. As mentioned, this would be very inefficient with more forms inputs. Instead, I need the submit button to submit the form and return with any errors, just like it does on the first submission.
Instructions for simple replication of the issue
Using the demo on the link above:
Further information
There are a couple of lines of configuration within the code which I’ll point out, to save wading through and trying to understand it:
Beta Was this translation helpful? Give feedback.
All reactions