Add support for custom validation messages
See original GitHub issueThe component currently has a set of predefined validation error messages inside resources
object in validators.js
.
It would be very nice to be able to specify custom validation messages other than those that are predefined.
Example:
required:true,
min:6,
validator: VueFormGenerator.validators.string,
validatorMessage: "Password must be at least {1} characters",
This would basically replace the predefined message textTooSmall
and would display the specified validatorMessage.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to create a custom validation error message that contains ...
On the Home tab, click Add Rule, click Is Not Between, and then click Show Validation Error. In the ScreenTip text box of...
Read more >How to Add Custom Validation Messages?
To add a custom validation message to a field go to Form > Edit Field > Advanced > Custom Validation Message. Updated on...
Read more >Custom Validation MessageSource in Spring Boot - Baeldung
Learn how to register a custom MessageSource for validation messages in Spring Boot.
Read more >Custom Validation Messages | QuestionPro Help Document
To add a new validation message Go to: Login » Surveys (Select Survey) » Edit. Click on the Validation icon on the question....
Read more >HTML5 form required attribute. Set custom validation message?
In my case I want to check that the value is a number before posting but I can't use the type="number" attribute (for...
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
I see your point. Maybe have the possibility to specify the validators as an array of objects
Since you iterate through each validator in the array, you can verify if it’s an object and if it has a custom message, then you can pass the custom message to the validator function. Don’t know if it’s worth it though after looking through the code.
I implemented it in #169