You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two examples of custom error message in your documentation, but they are doesn't work:
Example of a specific input field's error message: <input type="text" data-validate-length-range="2,6" required="required" pattern="alphanumeric" data-validate-text-invalid='Please follow the pattern rules'/>
Another example:
<input type="text" name="mySpecialInput" data-validate-length-range="2,6" required="required" pattern="alphanumeric" />
var validator = new FormValidator({
texts : {
mySpecialInput: 'wrong input' // set custom error message for that specific field, by "name"
}
});
So I searched for data-validate-text-invalid in validator.js and didn't find it, this functionality is not implemented.
So I wrote it by myself. In the checkField function we get testResult from hasValue. Must be passed to hasValue an option data, not data.value
In the function hasValue we can check data.invalidtext and show it instead of the default error
Now I have custom errors via data-validate-text-invalid attribute.
The text was updated successfully, but these errors were encountered:
There are two examples of custom error message in your documentation, but they are doesn't work:
Example of a specific input field's error message:
<input type="text" data-validate-length-range="2,6" required="required" pattern="alphanumeric" data-validate-text-invalid='Please follow the pattern rules'/>
Another example:
On your demo page doesn't work too http://yaireo.github.io/validator/ https://skr.sh/sC41V6PuNAu
So I searched for data-validate-text-invalid in validator.js and didn't find it, this functionality is not implemented.
So I wrote it by myself. In the checkField function we get testResult from hasValue. Must be passed to hasValue an option data, not data.value


In the function hasValue we can check data.invalidtext and show it instead of the default error
Now I have custom errors via data-validate-text-invalid attribute.
The text was updated successfully, but these errors were encountered: