Docs
Guides
Validation triggers

Validation triggers

Formeus has three basic validation triggers. This makes it trivial to achieve common form behaviours but also combine them in different ways.

Manual

Calling runValidation method for the specific field at any point.

For example, you can call it right after updating your field value, or perhaps when the input field loses focus.

Automatic

Formeus can be configured to auto run validations on every update.

Use config object to control this behaviour on particular instance or use setFormConfig function to control this behaviour globally.

ℹ️

Validations don't automatically run when form instance is created.

On Submit

Calling the submit method will cancel any running validations and start validation of all of your form fields.

Assuming all validations pass, the supplied onSubmitForm function will be called with the latest form values.

submit method can be configured to run validations sequentialy or concurrently via the options on config property.