A validator() funciton can be defined for an entire form or for individual form fields.
By default Vaadin Form runs validator functions on every state change (on every key stroke).
The validator() function could be used in the same way with any form API or rendering approach.
validator() functions can be combined in chains to create complex validation rules.
const form = new VaadinForm();
// init the form
const passwordRepeatedCorrectly = values => {
if (values.password !== values.passwordRepeated) {
return `Please check that you've repeated the password correctly.`;
}
};
form.validator = [passwordRepeatedCorrectly];
validator()
funciton can be defined for an entire form or for individual form fields.validator
functions on every state change (on every key stroke).validator()
function could be used in the same way with any form API or rendering approach.validator()
functions can be combined in chains to create complex validation rules.