Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding support for async validation rules #218

Open
kashifshamaz21 opened this issue Mar 19, 2014 · 4 comments
Open

adding support for async validation rules #218

kashifshamaz21 opened this issue Mar 19, 2014 · 4 comments

Comments

@kashifshamaz21
Copy link

In current implemenation of the plugin, we can only perform synchronous validations on model attributes. But in many cases, certain model fields need a basic client side validation (synchronous: well supported in plugin) and firing an ajax call to asynchronously validate the field's entered value on server.
Adding support for such rules would be great, as otherwise, it would need custom handling more often than not.
We can think on the lines of using promises while resolving validation rules to take care of it.
Let me know your thoughts on this enhancement, and will be happy to help!

@Spinarooni
Copy link

+1

@hakunin
Copy link

hakunin commented Nov 5, 2014

+1 I need this for phone number validation, which will happen server side since the validators need to agree and I don't want to require a huge JS lib that does the validation client side

@Webdesignwill
Copy link

You can create a validator and extend the Validation.validators object with it. I do this by adding a unique validator, on blur, checking to see if it exists or not and then returning true or false to validation.

With the current implementation, it only works with synchronous ajax calls but it would be great if it worked async.

@jblotus
Copy link

jblotus commented Aug 3, 2015

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants