Rule n° 72 - The input format for form fields which require it is indicated.
Let us not turn a date entry, currency or other into a guessing game. With or without a dash or hyphen.The year or the month first? Etc.etc. And as for password fields:, Is there an uppercase letter needed, special character or other magical formulae?
Goal
- Reduce the risk of input errors.
- Reduce the risks associated with sending incorrect or unusable data.
- Prevent the user from giving up, for lack of information about the expected input.
- Improve the accessibility of content for people with disabilities.
Solution technique
Indicate what is the expected input format using the label associated with the field. For example: <label for="mail">Email Address (of the type mail@example.com)</label>
Moyen de contrôle
For each form:
- Submit various possible errors in each form, for non-compliance with a requested or predictable format (format of email address, date, etc.), in order to detect the fields for which a specific input format is required.
- Check, using a code inspector, that the label associated with each relevant field indicates the expected format in the label element or by using an ARIA attribute.