Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Or constraints #15

Open
troyji opened this issue Aug 15, 2011 · 1 comment
Open

Feature Request: Or constraints #15

troyji opened this issue Aug 15, 2011 · 1 comment

Comments

@troyji
Copy link
Contributor

troyji commented Aug 15, 2011

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)'/>
@vivin
Copy link
Owner

vivin commented Aug 15, 2011

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants