validateField()
Validates a single form field.
validateField(name: string & keyof TSchema): unknown;
Notes
- This method updates the errors property for the specified field, and also updates the valid property based on all (remaining) validation errors.
- If the field has no validation schema, the method returns the field value unchanged.
- This method does not emit a change event on the form state object. To update bindings for errors after calling this method on its own, call
emitChange()yourself afterwards.
Parameters
- name — The name of the field to validate
Return value
The validated field value, or undefined if the field is not valid
Related
class FormState
An object that contains form field data, with validation rules.
