regula
regula copied to clipboard
Feature Request: Or constraints
It would be nice to have the ability to 'Or' constraints.
Use Case: I have an input field that can be blank. If it is not blank, it should be an integer.
Potential Solution:
<input type='text' data-constraints='@Blank | @Integer @Min(value=0)'/>
Currently this can be accomplished with a custom constraint. This is definitely a cool feature and I'd like to implement something like this at some point in the future. It would require changing the parser and also the way validation is performed. Currently each constraint is validated independently.