> For the complete documentation index, see [llms.txt](https://abb-vlaanderen.gitbook.io/handleiding-appuniversum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://abb-vlaanderen.gitbook.io/handleiding-appuniversum/research-and-ongoing/form-validation-and-errors.md).

# Form Validation & Errors

## Main pattern

### Help Text

Help text gives information up front so people know what to fill out in forms. Example:

![](https://3993208842-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MV0jY_qXNJed_-aeOPm%2F-Mk6yEbvZchsw3Mv0A42%2F-Mk7-0VR-yPggmlymrpt%2FScreenshot%202021-09-21%20at%2012.56.21.png?alt=media\&token=3a9f2659-b97a-47af-bda7-d9da3e38bafc)

{% embed url="<https://appuniversum.github.io/ember-appuniversum/docs/atoms/au-helptext>" %}

### Error

Whenever something is not filled out or filled out incorrectly; it becomes clear with icons, colours and text.

![example of error](https://3993208842-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MV0jY_qXNJed_-aeOPm%2F-Mk6yEbvZchsw3Mv0A42%2F-Mk6zUPL7x-eTQUumfGD%2FScreenshot%202021-09-21%20at%2012.53.42.png?alt=media\&token=2aab3032-4e80-4b63-947a-d0497fb694e1)

{% embed url="<https://appuniversum.github.io/ember-appuniversum/docs/atoms/au-form-input#error-input>" %}

## Generic Form Validations and Errors

| **Field**                                                                                                                                                                                                                             | Help Text                              | Error                                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>Mandatory field: free form</strong></p><p><strong>Verplicht veld: vrij</strong></p><p><strong><code>Can be combined with other fields</code></strong></p>                                                                  |                                        | Vul het veld in.                                                                                                                                                                                   |
| <p><strong>Mandatory field: select</strong></p><p><strong>Verplicht veld: selectie</strong></p><p><strong><code>Can be combined with other fields</code></strong></p>                                                                 |                                        | Selecteer een optie.                                                                                                                                                                               |
| <p><strong>Mandatory field: fill out at least on of these fields</strong></p><p><strong>Verplicht veld: vul een van beide (of meerdere) velden in.</strong></p><p><strong><code>Can be combined with other fields</code></strong></p> |                                        | Vul een van beide velden in: Naam of Naam.                                                                                                                                                         |
| **Phone number Telefoonnummer**                                                                                                                                                                                                       | Bijvoorbeeld: +3211211430.             | Enkel een plusteken en cijfers toegelaten.                                                                                                                                                         |
| **Website**                                                                                                                                                                                                                           | Bijvoorbeeld: <http://www.website.com> | Geef een geldig internetadres in.                                                                                                                                                                  |
| <p><strong>Email address</strong></p><p><strong>E-mail adres</strong></p>                                                                                                                                                             | Bijvoorbeeld: <mail@adres.com>         | Geef een geldig e-mailadres in                                                                                                                                                                     |
| <p><strong>Date</strong></p><p><strong>Datum</strong></p>                                                                                                                                                                             | Formaat: DD/MM/JJJJ                    | Geef een geldige datum in.                                                                                                                                                                         |
| <p><strong>Social Security Number</strong></p><p><strong>Rijksregisternummer</strong></p>                                                                                                                                             | Formaat: 00.00.00-000.00               | <p><code>If duplicate</code> Rijksregisternummer moet uniek zijn (indien ingevuld). Deze persoon bestaat al in de database.<br><code>If faulty</code> Geef een geldig rijksregisternummer in. </p> |

## Future improvements

### Phone numbers

Make the pattern easier to follow and the data more consistent by already providing **land codes** and flags for delight in a drop down:

![https://dribbble.com/shots/15474151-Phone-Number-Input-Field-Exploration](https://3993208842-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MV0jY_qXNJed_-aeOPm%2F-Mk6yEbvZchsw3Mv0A42%2F-Mk7LWtTj9MvSfs60ejF%2FScreenshot%202021-09-21%20at%2014.34.51.png?alt=media\&token=48319b8e-b90e-43a3-99ac-6f5183ba3d1d)

### URL's

Make the field easier to complete and the data more consistent by already foreseeing **https\://** in the field.

![https://dribbble.com/shots/5735249-Design-System-Text-Field](https://3993208842-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MV0jY_qXNJed_-aeOPm%2F-Mk6yEbvZchsw3Mv0A42%2F-Mk7LPoUj7lk73Zw_ixg%2FScreenshot%202021-09-21%20at%2014.34.21.png?alt=media\&token=cc17c7c8-01df-4c40-bc34-60a49e86c9b8)

### Adress

We don't have CRAB integration everywhere yet.

Basic Form Validation for an Address

| **Field**         | Help Text | Error                       |
| ----------------- | --------- | --------------------------- |
| Adres: Straat     |           | Vul het volledige adres in. |
| Adres: Huisnummer |           | Vul het volledige adres in. |
| Adres: Busnummer  |           |                             |
| Adres: Postcode   |           | Vul het volledige adres in  |
| Adres: Gemeente   |           | Vul het volledige adres in. |
| Adres: Provincie  |           | Vul het volledige adres in. |

#### Crab integration

1. Type the address
2. Add the bus number

*You can, if the address or bus number is not available, get in touch with the help desk so they can get in touch with CRAB to add it.*

![Two separate fields for address and bus number](https://3993208842-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MV0jY_qXNJed_-aeOPm%2F-Mk7lRLbJV77eokCszwv%2F-Mk7oREu5OhzLKCJ7tH1%2FScreenshot%202021-09-21%20at%2016.44.00.png?alt=media\&token=d8a5ef5f-2840-4be6-8d1b-2e907781cf76)

![An address is only available if they are available in the CRAB database.](https://3993208842-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MV0jY_qXNJed_-aeOPm%2F-Mk7lRLbJV77eokCszwv%2F-Mk7pU2cUXoE2mzxpOAK%2FScreenshot%202021-09-21%20at%2016.44.08.png?alt=media\&token=c60a345f-2f32-43b5-9f19-2ef28679b001)

![Bus numbers are only available if they are available in the CRAB database.](https://3993208842-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MV0jY_qXNJed_-aeOPm%2F-Mk7lRLbJV77eokCszwv%2F-Mk7pJL2orcfUfvr9XMo%2FScreenshot%202021-09-21%20at%2016.48.54.png?alt=media\&token=6f744bc5-f2d7-4446-98f6-b78f75cafcec)

![Filled out fields](https://3993208842-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MV0jY_qXNJed_-aeOPm%2F-Mk7lRLbJV77eokCszwv%2F-Mk7pMfz91kp9kygfgYm%2FScreenshot%202021-09-21%20at%2016.48.11.png?alt=media\&token=f2b855a8-b029-4361-9248-72363306c33d)

![Empty state for address](https://3993208842-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MV0jY_qXNJed_-aeOPm%2F-Mk7lRLbJV77eokCszwv%2F-Mk7pbhnZAflZC3eY8VB%2FScreenshot%202021-09-21%20at%2016.46.05.png?alt=media\&token=71864902-13b5-47f3-9ffa-f0c2df5450c5)
