Remove fieldset from date field I am trying to remove the &lt;fieldset&gt; surrounding a date popup field, but I find that the label is also removed. This is my code:

function mymodule_profile_form_alter(&amp;$form, $form_state, $form_id) {

  global $user;
  //print_r($form['field_last_name']);

  $form['field_birthdate']['und'][0]['#theme_wrappers']=$form['field_birthdate']['und'][0]['#theme_wrappers'][0];
}


Can anyone help me to solve this problem?
Typically there is a theme function associated with the different sort of output you can give data fields or indeed any fields If you want to change this you do so on the theme level by overriding the default theme function in your themes template.php file.

Date popup

function YOURTHEME_date_popup($vars) {
  $element = $vars['element'];
  $attributes = !empty($element['#wrapper_attributes']) ? $element['#wrapper_attributes'] : array('class' =&gt; array());
  $attributes['class'][] = 'container-inline-date';
  // If there is no description, the floating date elements need some extra padding below them.
  $wrapper_attributes = array('class' =&gt; array('date-padding'));
  if (empty($element['date']['#description'])) {
    $wrapper_attributes['class'][] = 'clearfix';
  }
  // Add an wrapper to mimic the way a single value field works, for ease in using #states.
  if (isset($element['#children'])) {
    $element['#children'] = '&lt;div id="' . $element['#id'] . '" ' . drupal_attributes($wrapper_attributes) .'&gt;' . $element['#children'] . '&lt;/div&gt;';
  }
  return '&lt;div ' . drupal_attributes($attributes) .'&gt;' . theme('form_element', $element) . '&lt;/div&gt;';
}


Although it must be said this is being themed as a form_element so there is no fieldset.

Date combo is themed as a fieldset and again can be overriden...

function YOURTHEME_date_combo($variables) {
    $element = $variables['element'];
    $field = field_info_field($element['#field_name']);
    $instance = field_info_instance($element['#entity_type'], $element['#field_name'], $element['#bundle']);

    // Group start/end items together in fieldset.
    $fieldset = array(
            '#title' =&gt; t($element['#title']) . ' ' . ($element['#delta'] &gt; 0 ? intval($element['#delta'] + 1) : ''),
            '#value' =&gt; '',
            '#description' =&gt; !empty($element['#fieldset_description']) ? $element['#fieldset_description'] : '',
            '#attributes' =&gt; array(),
            '#children' =&gt; $element['#children'],
    );

    // Fix required marker.
    if ($element['#required']) {
        $fieldset['#title'] .= " " . theme('form_required_marker');
    }
    return theme('fieldset', array('element' =&gt; $fieldset));
}


If you replaced 'fieldset' with 'form_element' this would work.