---
url: "http://webaim.org/techniques/forms/controls"
titulek: "WebAIM: Creating Accessible Forms - Accessible Form Controls"
h1: "Creating Accessible FormsAccessible Form Controls"
popis: ""
jazyk: "en"
kanonicka: ""
drobecky: ["You are here:", "Home", "Articles", "Forms"]
zdroj: "live"
wayback_snapshot: ""
stazeno: "2026-09-15 05:42:52"
znaku: 8688
slov: 1137
kodovani: "utf-8"
sha256: "2f4eaf9a1d9b83ea0468fa014f3e79e1b78c352c2a250955a732c1685b9122d5"
---
# Creating Accessible Forms
Accessible Form Controls
You are here: [Home](/) > [Articles](/articles/) > [Forms](./) > Page 2: Accessible Form Controls
## Text Inputs
Name:
Name:
Matching `for` and `id` values associate the label with its form control. Because `id` attribute values must be unique on each page, a form control can only have one associated ``.
You can also create the association by placing the label text and the input within the `` element (and not using `for` and `id`).
Name:
Note
Another benefit of labels is that the user can click on the label to set focus to the form control. This is useful on small screens and to some people with motor disabilities, particularly when targeting small checkboxes and radio buttons.
Clicking on labels is also an easy way to check for proper form labeling. If clicking the label sets focus to or activates the form control, then that label is programmatically associated.
## Text Areas
Enter your address:
Enter your address:
## Checkboxes
Select your pizza toppings: Ham
Pepperoni
Mushrooms
Olives
Select your pizza toppings:
Ham
Pepperoni
Mushrooms
Olives
The `` contains the group of checkboxes, and the `` labels the group. Screen readers may repeat the legend for each control in the group, so the legend text should be brief and descriptive.
## Radio Buttons
Choose a shipping method: Overnight
Two day
Ground
Choose a shipping method:
Overnight
Two day
Ground
Note
Fieldset and legend should only be used when a higher-level label is necessary. Single checkboxes or basic radio buttons that make sense from their labels alone do not require fieldset and legend.
Nested fieldsets can cause odd screen reader behavior and should be avoided.
## Other Input Types
Other ` ` types – `password`, `file`, `date` and `time` (and various data/time alternatives), `email`, `tel`, `url`, `number`, `color`, and `range` – must also have associated descriptive text using `` elements.
## Select Menus
Which is your favorite city?
Which is your favorite city?
Amsterdam
Buenos Aires
Delhi
Hong Kong
London
Los Angeles
Moscow
Mumbai
New York
São Paulo
Tokyo
### Grouping options
Long lists of options can be grouped with ``. However, since [`` is sometimes ignored in the screen reader environment](//a11ysupport.io/tech/html/optgroup_element), don't rely on this technique to convey vital context.
Which is your favorite city?
Which is your favorite city?
****
Delhi
Hong Kong
Mumbai
Tokyo
**
**
Amsterdam
London
Moscow
**
**
Los Angeles
New York
**
**
Buenos Aires
São Paulo
** **
### Multiple-select menus
Multiple-select menus allow the user to choose more than one option.
What are your three favorite cities?
Note
**Avoid using multiple-select menus.** Not all browsers provide intuitive keyboard navigation for them. Many users do not know to use Control/Command or Shift + click to select multiple items. A group of checkboxes provides similar functionality in a more accessible way.
## Buttons
Screen readers announce the nested text for `` elements, and the `value` attribute for input buttons. Form buttons must never be empty.
**Activate**
[Reset buttons should not be used](//www.nngroup.com/articles/reset-and-cancel-buttons/) unless specifically needed, because they are easy to click by mistake.
### Image buttons
Image buttons (` `) must have equivalent `alt` text. Otherwise, screen reader users will just hear "button", with no indication of what the button does.
## JavaScript Jump Menus
A jump menu is a `` (or a custom widget that behaves like one) that triggers page changes or navigation when a user clicks an option with the mouse.
When navigating with a keyboard, merely *browsing* the options with the arrow keys can trigger the change. This unexpected navigation can confuse and disorient keyboard and screen reader users. A jump menu should be replaced with a standard `` menu and button, with the button acting as the trigger. The exact behavior varies across browsers and operating systems.
### Bad example
This is a typical example of the problem. In some browsers, navigation to the first option will be triggered spontaneously when the user tries to explore the options.
Go to a website:
### Good example
Triggering from a submit button supports keyboard accessibility across all browsers. Users can explore the options using the up/down arrow keys and then click the Submit button.
Go to a website:
## Important Attributes
### `autocomplete`
Form fields collecting [certain types of user-specific information](//www.w3.org/TR/WCAG21/#input-purposes) need appropriate `autocomplete` attributes to identify input purpose. Users can benefit when common field types (name, address, birthdate, etc.) are represented consistently across the web. The ability to programmatically determine the purpose of each field makes filling out forms easier, especially for people with cognitive disabilities.
Name:
Name:
### Required fields
While required fields are commonly identified with an asterisk, users may not understand this convention. Additionally, screen readers may not always announce this character.
#### `aria-required`
If the indication that a field is required is presented outside the input label, applying the `aria-required="true"` attribute will cause screen readers to announce "required" along with the label text. No validation or "enforcement" mechanism comes along with this attribute, and it has no visual impact.
All fields below are required.
Name:
#### `required`
The HTML `required` attribute likewise causes screen readers to announce "required", and also triggers the browser to warn the user if the user leaves the field blank.
### Invalid fields
When performing form validation, applying the `aria-invalid="true"` attribute to a form control will cause the screen reader to announce "invalid" when that control gets the focus—and that's all. There is no visual impact. You can apply this to required fields that the user left blank or to fields that failed validation in some other way. This is helpful to users who cannot see the icons and color changes that are typically used to flag errors visually.
Name:
[Next](advanced)