Forms allow users to enter data by typing or selecting from a set of options. When forms are not designed with accessibility in mind, people with disabilities are likely to have difficulty or even find it impossible to enter data without errors. So forms need to be designed so that the purpose of each control is clear.
-
Provide an accessible label for every control. Preferably, give each control a visible text label that explains its purpose. This is best done with an HTML label element that’s programmatically associated with the control.
- For a text input field, its accessible label would be a short description of the data the field collects.
- For a control that is a group of options, such as a drop-down menu or list of radio buttons or checkboxes, the group should have a label that describes the relationship of the options. Each label should have a short description that indicates the value associated with each option.
- Make sure the label remains visible when the control has focus. Wherever possible, avoid relying on placeholder text to label an input field. There are several usability issues relating to placeholder text because it disappears when the user starts to type into the field. So it's much better to have an external label that remains visible at all times. If space is limited, such as when designing responsively for small screens, media queries could be used to change how label text is displayed.
- Provide additional input instructions when they are needed. Some controls may collect data that has constraints (such as upper or lower limits) or restricted formats. Preferably, use controls that only allow selections within those constraints. If this is not possible, provide additional text that describes the constraints in plain language.
- Provide additional information (metadata) to help people better understand and recognize the intention of input forms. People who have difficulty completing forms requesting personal data -- for example, those with cognitive or mobility impairments -- will benefit, because it will save time and eliminate typing or spelling errors. Most browsers today recognize well-labeled input fields corresponding to name and address. If the user allows the browser to autofill and store personal information in the settings, the browser will suggest values to complete the fields. This makes entering data faster and more accurate by eliminating typing errors.
Testing
For each form control:
- If the control is a text input field, is there a visible text label that describes what should be entered into the field?
-
If the control is a group of selectable options, such as a dropdown menu or list of radio buttons or checkboxes, are both of these true?
- There is a visible, meaningful label describing the collection of options.
- Each option has a visible, meaningful label that conveys the value of the options.
-
If there is no visible label for a control, are both of these true?
- There are sufficient visual clues to explain the function of the control.
- There is label text that is programmatically associated with the control, and the label is read aloud by a screen reader when it encounters the control.
- If users need additional information to interact with the control, is that information provided accessibly?
- Has the autocomplete attribute been leveraged to allow additional information to be offered to users to assist them in understanding and recognizing the intention of input fields?