Several mods of validation for the same form
See original GitHub issueIs your feature request related to a problem? Please describe.
From requirements perspective I need to have two fields to be validated using onChange
approach and the other one is onBlur
.
Describe the solution you’d like Give possibility to override default form Mode. For example
type FormType = {
firstName: string;
secondName: string;
age: number;
}
const form = useForm<FormType>({
mode: 'onChange',
fieldOptions: { firstName: { mode: 'onBlur' } },
});
Describe alternatives you’ve considered
As alternative I tried to use onBlur
prop, checking manually against desired requirement (in my case it’s a regexp). And then manually setting error. But it feels a bit cumbersome, because now I have validation in several places.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
How To Create A Multiple Data Validation In The Same Cells ...
In this video we'll learn how to incorporate multiple criteria into the same cells to prohibit invalid entries when using Data Valdiation.
Read more >Blazor: validating multiple forms with the same model
Unfortunately, when the first form is displayed and submitted, the missing field is validated, and the validation fails. Is there any way to...
Read more >Moodle in English: Custom Form validation Function...How?
Hello, i have developed a own "add Resource"-Functionality but now i need to validate one Field on the Serverside by a custom Function....
Read more >Design Principles for Enhancements to MODS and MADS
Goals to guide the enhancement of MODS and MADS ; 5. Support validation of the encoding. 1) Adopt widely used and supported validation...
Read more >Validate function in Power Apps - Microsoft Learn
The Validate function checks whether the value of a single column or a complete record is valid for a data source. Description. Before...
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 Free
Top 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
Nevertheless I totally understand your desire to keep api as simple as possible. So I am ok with current solution and enjoying using library ❤️. Just thought it would be not that hard to add functionality I’ve suggested.
I guess we might close now.
thanks for understanding 🙏 @s5unanow I will close the issue until more users report for such API to be reconsidered.