validateFields
We saw that the form
validator supports the ability to perform field-level validation in addition to form-level validation. To validate one or some fields, an array of field names can be supplied in the validation context. While straightforward, this code is verbose. For that reason, Strickland's form
validator provides a validateFields
helper function.
Here is some application code that performs field-level validation without the validateFields
helper.
The validateFields
helper is available from the validator created using the form
validator factory.
Once initial validation has occurred, validateFields
can accept existing validation results to be updated during field-level validation.
Last updated