Closed matthijn closed 6 years ago
You can validate that two fields are equal but that's it for now: http://validatejs.org/#validators-equality
If you want something more advanced you'd have to write your own validator.
but when single value validation. it's not possible. right?
No, how would that even work?
Is it possible to compare with another field? There are two places where this could be useful:
Comparing "repeating password / email fields" or comparing dates (e.g one should be before another date). I'd say these are both fairly common in form handling. But I can't seem to figure out how to to either of these.
edit: It seems I can create a custom validator, and use an option to set the field to compare it to. And get that value from the attributes object.