Error message

You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).

function theme_checkboxes

Returns HTML for a set of checkbox form elements.

Parameters

$variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #children, #attributes.

Related topics

Default theme implementations
Functions and templates for the user interface to be implemented by themes.
Form generation
Functions to enable the processing and display of HTML forms.

File

includes/form.inc, line 3262

Code

function theme_checkboxes ($variables) {
 $element = $variables['element'];
 $attributes = array();
 if (isset($element['#id'])) {
 $attributes['id'] = $element['#id'];
 }
 $attributes['class'][] = 'form-checkboxes';
 if (!empty($element['#attributes']['class'])) {
 $attributes['class'] = array_merge ($attributes['class'], $element['#attributes']['class']);
 }
 if (isset($element['#attributes']['title'])) {
 $attributes['title'] = $element['#attributes']['title'];
 }
 return '<div' . drupal_attributes ($attributes) . '>' . (!empty($element['#children']) ? $element['#children'] : '') . '</div>';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.