Custom error message alongside custom validation
See original GitHub issueWasn’t sure whether this was an issue so I post it as a feature.
I’m just getting started with this package and i already like it. For the sake of keeping related things closed, is it possible to keep custom error messages alongside a custom validation method just like required or min or max? And if not I think that would be a nice feature to have. Would reduce the number of type comparison to display the error messages.
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to return custom error message from controller method ...
I'm talking about a custom message like can be done here... $messages = [ 'required' => 'The :attribute field is required.', ]; $validator...
Read more >Providing custom error messages for built-in HTML5 form ...
How to customize built-in form validation error messages. Grab the input element(s) with a querySelector / querySelectorAll .
Read more >Custom Error Messages - express-validator
If you're using a custom validator, then it may very well throw or reject promises to indicate an invalid value. In these cases,...
Read more >Display Different Error Messages Using Custom Validation!
Requiring specific answers To do this: Select your Address field and find the Custom Error - When option in the field settings. From...
Read more >Validation - Laravel - The PHP Framework For Web Artisans
Working With Validated Input; Working With Error Messages. Specifying Custom Messages In ... Validating Files; Validating Passwords; Custom Validation Rules.
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

Thank you for your kind words! 👍 so glad to hear you like it.
hahaha YES, and it’s documented:
https://react-hook-form.com/api#register
check the checkbox of
Register with validation and error messageand scroll down, you should see updated code example and description. I will thin a better way of showing a notification or something in the future
In fact, u probably can reuse those validation rules that you created with the associated message too.
sounds good @jgb-solutions feedback welcome! going to close this issue now 😃