function theme_fieldset

7.x theme_fieldset($variables)
5.x theme_fieldset($element)
6.x theme_fieldset($element)

Returns HTML for a fieldset form element and its children.


$variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #attributes, #children, #collapsed, #collapsible, #description, #id, #title, #value.

Related topics

75 string references to the theme hook from theme_fieldset()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

aggregator_admin_form in drupal/modules/aggregator/
Form constructor for the aggregator system settings.
aggregator_form_aggregator_admin_form_alter in drupal/modules/aggregator/
Implements hook_form_aggregator_admin_form_alter().
block_admin_configure in drupal/modules/block/
Form constructor for the block configuration form.
block_form_user_profile_form_alter in drupal/modules/block/block.module
Implements hook_form_FORM_ID_alter() for user_profile_form().
color_form_system_theme_settings_alter in drupal/modules/color/color.module
Implements hook_form_FORM_ID_alter().

... See full list


drupal/includes/, line 2833
Functions for form and batch generation and processing.


function theme_fieldset($variables) {
  $element = $variables['element'];
  element_set_attributes($element, array('id'));
  _form_set_class($element, array('form-wrapper'));

  $output = '<fieldset' . drupal_attributes($element['#attributes']) . '>';
  if (!empty($element['#title'])) {
    // Always wrap fieldset legends in a SPAN for CSS positioning.
    $output .= '<legend><span class="fieldset-legend">' . $element['#title'] . '</span></legend>';
  $output .= '<div class="fieldset-wrapper">';
  if (!empty($element['#description'])) {
    $output .= '<div class="fieldset-description">' . $element['#description'] . '</div>';
  $output .= $element['#children'];
  if (isset($element['#value'])) {
    $output .= $element['#value'];
  $output .= '</div>';
  $output .= "</fieldset>\n";
  return $output;