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.

validateAll always returning true, I'm using rc25

See original GitHub issue

Versions:

  • VueJs: 2.3.3
  • Vee-Validate: 2.0.0-rc.25

Description:

this.$validator.validateAll().then((result) => { if (result) { self.submitForm(); return; } })

For the very first time, it is validating and throwing error. But, for the subsequent calls, it is always returning true.

Steps To Reproduce:

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
logaretmcommented, Nov 27, 2017

You didn’t provide an example, but from what I can gather validateAll only validates scopeless fields, to validate a specific scope you need to pass it to validateAll

this.$validator.validateAll('fb-form');

Now if you wish to validate all fields regardless of scope you can use validate without any parameters:

this.$validator.validate(); // validates all fields on the validator instance
0reactions
pybalacommented, Nov 30, 2017

Thanks @logaretm Below code is clearing everything.

this.$nextTick(() => { this.$validator.reset(); });

Thanks, Bala

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - Veevalidate always return true Vuejs - Stack Overflow
In order to add a validation of vee-validate you need to add it as value to v-validate option and not directly within the...
Read more >
Validator API - VeeValidate
when validation is done, the Promise resolves a boolean indicating whether the selected was valid or not. validateAll(fields?: String or Object), Promise< ...
Read more >
vee-validate: Versions - Openbase
This means you can now always rely on the valid flag to present the accurate form state, note that the valid flag is...
Read more >
How To Use Form Validation in Vue - DigitalOcean
When all fields return valid as true , we can then go ahead to submit the form. For this tutorial, we are displaying...
Read more >
Form component — Vuetify
These allow you to specify conditions in which the input is valid or ... refs.form.validate() will validate all inputs and return if they ......
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