Picto thématique

Rule n° 69 - Each form field’s label indicates whether or not it is a required field.

It is better to prevent the user from making a mistake because they were not given enough information from the outset.

#Forms #Development #Privacy

Goal

  • 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.

Implementation

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.

Control

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 label element, in anaria-label attribute, or else that it is linked to the field via an aria-labelledby or aria-describedbyattribute.
  • 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.

By Opquast - Read the license