regula icon indicating copy to clipboard operation
regula copied to clipboard

Feature Request: Or constraints

Open troyji opened this issue 13 years ago • 1 comments

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)'/>

troyji avatar Aug 15 '11 22:08 troyji

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.

vivin avatar Aug 15 '11 22:08 vivin