Form methods

To retrieve the values of your form or to make changes to the form, the library provides you with several methods. These apply either to the entire form or to individual fields.

Do you like Modular Forms so far? It would be a great honor for us to get a star from you on GitHub!

Examples

With reset, for example, you can reset the form or update the initial values. With setResponse you can output information, general errors or success messages to the user.

To retrieve all or individual values of form fields use getValues or getValue. To manually update the value of a field or set an error use setValue and setError. If you want to validate a field manually, use the validate method.

API design

For each method, pass your form store as the first parameter. This leads to a readable API and allows a modular design. You can find an overview of all methods in our API reference.