Validate onSubmit, but don't validate onChange or onBlur
See original GitHub issueAfter exploring the API, the examples and reading through the similar issues, I still don’t have a straight forward solution for this problem, so I am asking for your help.
I don’t want to validate each input field onChange
or onBlur
, but I want to validate all input fields onSubmit
. What would be the best way to approach this problem?
The form validation is synchronous and I am using version 6.3.2
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
Validate onSubmit, but don't validate onChange or onBlur #2413
I don't want to validate each input field onChange or onBlur , but I want to validate all input fields onSubmit . What...
Read more >react-hook-form: Validation not working when using onBlur ...
1 Answer 1 ; onChange, string, Validation will trigger on the change event with each input, and lead to multiple re-renders. Warning: this...
Read more >Spry Password Validation Widget - Adobe Open Source
The validation event can be 'onChange' - this means the validation will be triggered as you type. 'onBlur' - when the password field...
Read more >useField (Remix Validated Form)
Validates the form field and populates the error prop if there is an error. ... the values ( onChange , onBlur , onSubmit...
Read more >useForm | React Hook Form - Simple React forms validation
Validation will trigger on the submit event and inputs will attach onChange event listeners to re-validate them. onBlur, string, Validation will trigger on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Redux Form will run the validation function against any touched Fields. You need to configure Redux Form to not touch fields on a blur event by setting
touchOnBlur
tofalse
in the Redux Form config. (By default, this is already false for change events).Why not use
shouldValidate
config property and return false unless props.submitting is true?