Closed theogravity closed 7 years ago
All fields are optional unless you use the presence
spec.
You can also use a conditional constraint if you need CVV based on another attribute: http://validatejs.org/#constraints (see the example, creditCardZip to be specific)
@theogravity Look here: https://github.com/ansman/validate.js/issues/99#issuecomment-239890891
What's the proper way to validate an optional field?
For example, I have a field called
cvv
that's optional, but if filled in should be a min length of 3 with a max of 4 chars