question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No validation error for missing required field

See original GitHub issue

Versions:

  • 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:

See https://jsfiddle.net/tj0s1g88/1/

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TomKitacommented, Dec 1, 2016

I just tried the above on 2.0.0-beta.17 its fixed. 👍

0reactions
ndderycommented, Dec 9, 2016

@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 the errorBag.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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found