jpkleemans / angular-validate

Painless form validation for AngularJS. Powered by the jQuery Validation Plugin.
MIT License
68 stars 33 forks source link

Validate fields individually #16

Closed gaikwad411 closed 7 years ago

gaikwad411 commented 7 years ago

This validate plugin is great, it really helps to keep the code and logic clean and easy to understand.

I dont know if this feature is already there, may be it is not documented. But to explain another requirement, we may need to validate fields individually. Now fields are being validated when form gets submitted(all the fields), and there may be requirement to validate a single field on blur, or on particular event.

I have done a workaround for this, I created a directive for inputs in the form. And on blur event of input I just all "valid" function of validator and it does what I need.

My query is, is there any existing way to achieve the same, if not it would be nice to have thing.

jpkleemans commented 7 years ago

You can use the onfocusout option to validate fields on blur: https://jqueryvalidation.org/validate/#onfocusout

gaikwad411 commented 7 years ago

Hey Thanks, it was there.