Vee-validate: custom async validation failed to prevent form submission

Created on 12 Mar 2017  路  11Comments  路  Source: logaretm/vee-validate

https://jsfiddle.net/wangjia/u36apjoq/1/

validation failed, but the form was still submitted.
should i use reject method?
but when i use reject method, the errors msg is not displayed.

馃悰 bug

Most helpful comment

No problem man, exams have priority!

All 11 comments

@logaretm Please have a look!

Sorry, I wasn't available the past day. This is a weird issue, I will take a look and report back.

@wangjiamr Beta.23 seems to work fine, I still do not know what may be causing this.

I have identified the issue, and I will be fixing it along with new additions to the promises system in the library.

ok,thx for you attention, I always thought I was wrong.Wait for you to fix it.

And i have another questions.
Don't know how to deal with others, I am most of the async request here is written to the page.
so why don't I think so do it?
Remove it if the rule name exist.and displayed the warning in the dev environment.
just my humble opinion.

if(Validator.has('mineRule')){
Validator.remove('mineRule')
}
Validator.extend('mineRule',rule)

You should put:

Validator.extend('mineRule',rule)

in the startup place of your application, so it would only be added once, plus you can always:

Validator.remove('mineRule');
Validator.extend('mineRule',rule);

without the if check since remove fails silently and does not throw any exceptions

Any idea when this fix gets a release? :)
https://github.com/logaretm/vee-validate/commit/be9e548c36b07939b633b5348a232b2b252f8d67

(Switching back to Beta.23 fixes it for now)

no new version yet.and now i use /dist/vee-validate.js

Terribly sorry guys, I'm having exams next week and I'm trying to get as much time as possible on the project. There are few more things I would like to add to the next version before I release it.

No problem man, exams have priority!

Was this page helpful?
0 / 5 - 0 ratings