Closed
Description
New feature motivation
I have an input that accepts Spanish nie and Spanish nif. Specifiying one of the formats is enough to pass validation.
New feature description
Have a new "metamethod" that allows for defining this kind of behavior
New feature implementation
Right now the format for rules "ands" all the rules as far as I know like
rules: {
// simple rule, converted to {required:true}
name: "required",
// compound rule
email: {
required: true,
email: true
}
}
The email needs to pass required
AND email
methods.
A suggestion on how it could look like in the configuration:
rules: {
nifcif: {
oneof: {
nifES: true,
nieES: true
}
}
}
Maybe there is already a way to define this but I'm not aware of it.