Form Controller Status
Learn how to use the validation and input status to toggle the error message's visibility.
We'll cover the following...
At the moment, the error messages will appear instantaneously because validation is performed when the component loads. The user hasn’t had a chance to fill out the form. Typically, we want to wait until the user has provided a value before we validate it.
One workaround for this dilemma is to check if the user sends a value as an input. Every form controller comes with various status properties to help us understand what has been done to the input.
Controller statuses
Here’s a list of statuses. They’re all boolean values.
Status | Description |
---|---|
valid | The input is valid. |
invalid | The input is invalid. |
pending | Validation is still being performed on the input. |