jpkleemans / angular-validate

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

ngRequired #27

Closed mfrangella closed 5 years ago

mfrangella commented 6 years ago

Hi there, I need to make an element required based on the value of another, so I need to use ng-required, but then ngValidate is not taking in consideration it. Any solution?

jpkleemans commented 5 years ago

You can use a function to determine whether te required validation should be performed on a field. For example see https://stackoverflow.com/a/23953089/2572602 where they use such a function on the minlength validator.