-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validators - errors are not shown #15
Comments
There is a section in the docs around validation messages: https://matt-sanders.gitbooks.io/vue-formly/content/v/2.0/how_to_use/validation.html Messages are required for an error message to display. You can either add messages on a per-validation basis, or you can add global messages |
How would one set up a custom template to show the error messages if they occur as per your input template. I am trying to set custom template for all html5 input types e.g. number, date, email etc Your text input definition looks like below.
If I however change it to my own type as per the below template, the error messages disappear.
I would think that because I use the base field as a mixin, the validation messages will be added in..or not. Tnx |
@andyfensham the error messages display are added in the template, therefore simply extending You'll see on the |
I have a field with
validators: { looksOk: function(field, model, next){ next(model[ field.key ].indexOf('@') >= 0); } }
I see that on error the field wrapper is getting the error class but no error is shown below the field,
I have checked the configuration but found nothing on that
update:
I saw now that I can define the error message in the validate function for example:
validators: { minLength: { expression: 'model[field.key].length > 5', message: 'Your password must be at least 6 characters' } }
but I could not get the same functionality for a generic 'required' field
The text was updated successfully, but these errors were encountered: