Open SvetlinStaev opened 7 years ago
You can declare a message for each validation rule.
<input ..
data-validation-error-msg-phone_abuse="..."
data-validation-error-msg-caps_abuse="...">
http://www.formvalidator.net/#localization_inline
The error messages declared by the validator will be used if you leave out the inline declaration (data-validation-error-msg). If the input has an inline declaration it will be used every time the input gets invalid, instead of the messages coming from the validators.
I would like to validate a field based on a few criteria and I have created custom validators for each of them.
I load the criteria:
with the following validators:
This checks if the text is all caps, if it has a phone number in it and the default required validator.
The problem is regardless of the type of the failed validation only the text from the
data-validation-error-msg
attribute is shown. Is there a way to display theerrorMessage
from each of the custom validators when the validation fails for that particular validator?