Validation
Examples
{
type: "input",
inputType: "number",
label: "Age",
model: "user_age",
required: true,
hint: "Age is required & must be a whole number.",
validator: validators.integer
}{
type: "input",
inputType: "password",
label: "Password",
model: "password",
min: 6,
required: true,
// String validator with custom error messages
validator: validators.string.locale({
fieldIsRequired: "The password is required!",
textTooSmall: "Password must be at least {1} characters"
})
}
Setting a validator for a field
Use a function name
Use a string
Use an Array
Built in Validators
Custom Validators
Example of Custom Validators being Installed
Handling Validation Events
Debounced Validation
Last updated
Was this helpful?