Checkboxes

Last updated on
September 21, 2016 - 17:05

Problem

The user needs to select zero, one, or more options from a pre-defined set.

Solution

Checkboxes:
Screenshot of checkboxes at node creation page

Stand-alone checkbox:
Screenshot of a stand-alone checkbox on the account settings page

Use when

  • Multiple checkboxes are appropriate when the user needs to select zero, one, or multiple options.
  • A stand-alone checkbox is suitable whenever a user should be permitted to turn a single option on or off.

Recommendations

  • If you have a large number of checkbox options, a select list with the #multiple property may be an alternative (but this does not provide a very agreeable user experience, since users may not know how to select more than one item presented in this way — look for other ways to achieve the required functionality).
  • If labels for the description items in a stand-alone checkbox cannot readily include the words true/false or enable/disable, then it is better to use two radio buttons instead.

Wording of labels and descriptions

The label for a checkbox should be a statement or a descriptive phrase. Avoid beginning the label text with "Enable …" or "Is…", and do not end with a question mark or a period. Avoid negative expressions such as "Don't show this on the page", as that means the user has to make sense of a double negative.

Avoid beginning the description text with "Select to…" or "Choose to…". These are redundant words that adds waffle in front of the important, meaningful parts.

API

Checkboxes: Drupal 7, Drupal 6
Stand-alone checkbox: Drupal 7, Drupal 6