forms
forms copied to clipboard
Is it possible to create custom validators ? and create validator for, eg, two fields ?
never mind i found how :
validators: [(form, field, callback) => {
if (field.data !== "ok") {
callback("msg error");
} else {
callback();
}
}]
U may want to add this in documentation :)
but still i would love to know how to combine validations for a whole form
A PR to improve the documentation is always welcome!
Validations are performed per-field - you can certainly reuse a validator on as many fields as you like by storing the function in a variable, and passing that variable into multiple fields.