No validation error for missing required field
See original GitHub issueVersions:
- VueJs: 2.1.0
- Vee-Validate: 2.0.0-beta.14
Description:
Not sure if this is by design or not but there is no validation error returned for missing required fields when calling validateAll({ ... })
.
If validateAll()
only validates the fields it’s given, is there another method to run all attached validation rules, even on missing fields (especially useful for required
) ?
Steps To Reproduce:
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Validation Error: Required field missing: Phone Type
Validation Error : Required field missing: Phone Type · 1. Go to Config > Tables > Phone Types and check that the phone...
Read more >Error message for missing required field not visible - Drupal
I have a setup using vertical tabs and lots of fields. A few of these fields are required. When a user tries to...
Read more >Salesforce Error: Required Fields are Missing
This error means that either a mapping was missing in a step of your connector, the field was missing in the response, or...
Read more >Symfony Validation Error Message for Missing Required Form ...
This behavior can occur when the field is not presented in the form object itself. In this case violation mapper can't map validation...
Read more >Error 'required field is missing' when you deploy a change set
The error 'Required field is missing: sourceValues' is caused when report included in the Change Set contains a bucket field, ...
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 FreeTop 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
Top GitHub Comments
I just tried the above on 2.0.0-beta.17 its fixed. 👍
@logaretm sorry, been super busy at work and haven’t had time to try this solution…
We’ve opted to sync inputs back to the form component, and ensure that required fields are declared in the validated object (with
validateAll({ ... })
). We pass the error bag to each children of the form component, which allow us to place the field error wherever we want in the child component markup. This way, we can also have child component add their own validation with theerrorBag.add()
method, which we then pick up when validating the complete form. It’s far from perfect but it does the job right now.I’ll try and implement the beta.15 solution (having the validation rules on the component, and have it emit an
input
event) when I get the time. Thanks!