Open mark47 opened 8 years ago
Sorry, it's not possible yet. One of the next big improvements I want to make is to support returning a promise/deferred from a validator.
In your case though, you might be able to use data-remote
to check against a validation endpoint
Thanks @1000hz for the quick response. I played around with your suggestion to use data-remote
-- it's definitely the right direction, but the API (which alas I don't control) doesn't quite return data in a proper format for the validator to process.
Anyway, glad it's on the roadmap going forward. Thanks for all your work on this!
@mark47 just a lil plug, if you want to checkout dominar.js it has support for ajax validation the kind your looking for :)
I noticed some previous discussion of custom error handling when an ajax call is involved, but am having trouble getting it to work. Is there a way to employ
$deferred
or$promises
?My particular issue - using
@.ajax
to check whether an email address is already in our database. I want to return whether it is unique. Validator always returns something before my ajax is complete.