formvalidator performs both field-level and form-level validation. Field validators are supplied the same way
objectPropsvalidators are supplied as an object with the shape matching the form fields. The
formvalidator also allows previous validation results to be provided on context so that results can be updated with the new results merged in.
formvalidator factory is an object defining the properties to be validated on objects. Validator props can also be supplied either as an object or as a function that accepts context and returns a validator props object.
formvalidator utilizes validation context to perform field-level validation as well as to update previous validation results. Without any context provided, the entire form will be validated without using any previous validation results.
form.fieldscontext prop indicates which field(s) to validate.
form.fieldsis an array of strings, all items are treated as field names
form.fieldsis not supplied, all fields are validated
form.fieldsis an empty array, no fields are validated
validationErrorsarray and the possible
validateAsyncfunction that captures remaining async validation.
form.validationResults. These existing results will be retained, but any fields that are re-validated will be overwritten with their new results.
form.validationResults: An object with properties matching those validated, with the values of the properties representing the validation results. If the
form.fieldscontext props were used, then previous validation results that were not re-validated will be retained.
form.validationErrors: An array of validation results that are invalid, but excluding results where async validation remains to be completed.
form.isComplete: A boolean indicating whether the entire form has been validated.
form.validationResultscontains results for all field validators and none of those results has a
validateAsyncyet to be resolved.