We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We're using an enum in the db to restrict a varchar field to a set of values (required or optional - which of course is confusing in itself! :-p)
varchar
required
optional
Is this kind of validation possible?
necessity: [ 'required', { rule: 'contains', params: ['required', 'optional'] } ]
This only allows the first value... is this a bug or is this intentional? Is it possible to allow multiple valid values to be enumerated?
The text was updated successfully, but these errors were encountered:
+1 Would love to know too
Sorry, something went wrong.
+1 please.
This is the code i use (some kind of "ENUM") for testing for 2 values, "final" and "test":
// Extend Checkit object Checkit.Validator.prototype.types = function (val) { if (typeof val === 'string' && (val.toLowerCase() === 'test' || val.toLowerCase() === 'final')) { return true; } else { return false; } }
USE:
new Checkit({ my_param : ['types'] });
No branches or pull requests
We're using an enum in the db to restrict a
varchar
field to a set of values (required
oroptional
- which of course is confusing in itself! :-p)Is this kind of validation possible?
necessity: [ 'required', { rule: 'contains', params: ['required', 'optional'] } ]
This only allows the first value... is this a bug or is this intentional? Is it possible to allow multiple valid values to be enumerated?
The text was updated successfully, but these errors were encountered: