A form element that indicates selected values using a check mark. Used to capture selections from predefined values.
Used when there is a list of predefined options and the user can select any number of them.
These values should be sorted in an easily scannable order (e.g. alphabetically or by popularity).
By default, a checkbox or list of checkboxes should start unchecked.
Remember to wrap the checkbox(es) with fieldsets and legends to make them accessible.
Horizontal inline checkboxes can make it difficult to tell which label pertains to which checkbox, so use them sparingly.
Negative language in labels can be counterintuitive. For example, use “I want to receive a promotional email” instead of “I don’t want to receive promotional email.”
Selecting a checkbox should not trigger unexpected changes in context, such as causing significant changes to the page content or opening a new window.
Let users check the checkbox by clicking on either the checkbox itself or its label.
A form validation checks user input against success criteria before passing the data to the server. If there is a problem with the data then the system generates an error to help the user complete their task. An error notification is displayed at top of page, and any checkboxes that are in error are visually indicated.
Title case, 2-3 words maximum.
Do not combine actions in a label (exception: "Customize & Buy").
If standard labels don't fit the button's purpose, align label with the task the user is attempting.
Please refer to the Dell Technologies branding website, https://brand.delltechnologies.com/faq/#voice, for further information regarding call-to-action labels and usage.
A checkbox can be:
The aria-checked attribute of a checkbox indicates whether the input is:
A minimum touch target of 34 pixels in height should be used to assist with touchscreen interaction.
Provide instructions within labels to help users understand how to complete the form and individual form controls. Providing instructions outside of labels allows more flexible positioning and design, but sometimes it can be missed. It is also not supported by some web browsers (typically older versions) and assistive technologies that don’t implement WAI-ARIA.
Validate input (checkboxes selected) by the user and provide options to undo changes and confirm data entry.
Notify users about successful task completion, any errors, and provide instructions to help them correct mistakes.
Users should be able to select a checkbox by clicking on the box directly and by clicking on its label. This is useful to some with motor disabilities.
Use the <label> element, and in specific cases other mechanisms (e.g. WAI-ARIA, title attribute etc.), to identify each form control.
Matching for="name" and id="name" values associate the label with the appropriate form control.
Because id must be unique on each page, only one label can be associated to each unique form element. This means you cannot have one label for multiple form elements. Additionally, screen readers do not support multiple labels that are associated to the same form element.
As a best practice, groups of checkboxes should make use of <fieldset> (a tag that's used to group related elements in a form) and <legend> (a tag that defines a heading for the <fieldset> element). This is especially true for forms submitting data. Nested fieldsets should generally be avoided. In screen readers, the legend text is generally read for each control in the fieldset, so the legend text should be brief and descriptive. (see Inputs for more details)
Do not use fieldset and legend for a single checkbox.
There are exceptions to the above rule. For example, Data Tables make use of checkboxes as a way to select rows of data. Checkboxes in this context would represent an entire row of data in its associated table row.
The aria-required attribute informs assistive technologies about required controls so that they are appropriately announced to the users (as opposed to validating the input). Most current web browsers automatically set its value to true when the HTML5 required attribute is present.
If the submitted data contains errors, it is convenient to set the focus to the first <input> element that contains an error.