- Tell users in advance whether or not a field is required.
- Prevent mistakes before they are made.
- Improve the accessibility of content for people with disabilities.
Indicate that the entry is mandatory in the label associated with the field. If this indication is made with a symbol (an asterisk for example), an explanation of this symbol should come before the form.
For each form:
- Check that the label associated with each field indicates that it is mandatory, if necessary by checking, with a code inspector, that the information is indeed present in the
labelelement, in an
aria-labelattribute, or else that it is linked to the field via an
- Check that the fields with labels not specifying that they are mandatory are actually optional, by validating the form without completing these fields. If an error message indicates that they must be completed or if the form cannot be validated in this way, the best practice is not valid.