Drupal add fieldset inside form and wrap all form elements under that fieldset I want to add fieldset tag inside form tag. Also i want to wrap all the form element under this fieldset. I'm using the following function to change the form design and html. 

MY CODE: 

function change_password_form($form, &amp;$form_state) {
  if (user_is_anonymous()) {
    return $form; // Or drupal_access_denied()?
  }
  $form['#account'] = $GLOBALS['user']; 
  $form['fieldset']['current_pass'] = array(
    '#type' =&gt; 'password',
    '#title' =&gt; t('Current password'),
    '#size' =&gt; 25,
    '#required' =&gt; TRUE,
  );
  return $form;
}


CURRENT OUTPUT : 

&lt;form action="/projects/drupal/hpedu/change-password" method="post" id="change-password-form" accept-charset="UTF-8"&gt;
&lt;div&gt;
&lt;div class="form-item form-type-password form-item-current-pass"&gt;
  &lt;label for="edit-current-pass"&gt;Current password &lt;span class="form-required" title="This field is required."&gt;*&lt;/span&gt;&lt;/label&gt;
 &lt;input type="password" id="edit-current-pass" name="current_pass" size="25" maxlength="128" class="form-text required"&gt;
&lt;/div&gt;
&lt;div class="form-actions"&gt;&lt;input type="submit" id="edit-submit" name="op" value="Submit" class="form-submit"&gt;&lt;/div&gt;&lt;input type="hidden" name="form_build_id" value="form-pGcx3HehTZlOkicX1gaBrr5eBjv8iT6iccQvCN8uXTU"&gt;
&lt;input type="hidden" name="form_token" value="1qygden7YqhLlXvjiC8-ypYDXhOKwW_brUB4BdXlKNU"&gt;
&lt;input type="hidden" name="form_id" value="change_password_form"&gt;
&lt;/div&gt;
&lt;/form&gt;


EXPECTED OUTPUT : 

&lt;form action="/projects/drupal/hpedu/change-password" method="post" id="change-password-form" accept-charset="UTF-8"&gt;
&lt;fieldset class="myclass"&gt; &lt;!-- This Fieldset , which i want to add --&gt; 
&lt;div&gt;
&lt;div class="form-item form-type-password form-item-current-pass"&gt;
  &lt;label for="edit-current-pass"&gt;Current password &lt;span class="form-required" title="This field is required."&gt;*&lt;/span&gt;&lt;/label&gt;
 &lt;input type="password" id="edit-current-pass" name="current_pass" size="25" maxlength="128" class="form-text required"&gt;
&lt;/div&gt;
&lt;div class="form-actions"&gt;&lt;input type="submit" id="edit-submit" name="op" value="Submit" class="form-submit"&gt;&lt;/div&gt;&lt;input type="hidden" name="form_build_id" value="form-pGcx3HehTZlOkicX1gaBrr5eBjv8iT6iccQvCN8uXTU"&gt;
&lt;input type="hidden" name="form_token" value="1qygden7YqhLlXvjiC8-ypYDXhOKwW_brUB4BdXlKNU"&gt;
&lt;input type="hidden" name="form_id" value="change_password_form"&gt;
&lt;/div&gt;
&lt;/fieldset&gt;  &lt;!-- This Fieldset , which i want to add --&gt; 
&lt;/form&gt;


Any help would be greatly appreciated.
It should be something like this.

function change_password_form($form, &amp;$form_state) {
  if (user_is_anonymous()) {
    return $form; // Or drupal_access_denied()?
  }

  $form['#account'] = $GLOBALS['user']; 

  // To make the fieldset define #type as fieldset
  $form['fieldset'] = array(
    '#type' =&gt; 'fieldset',
    '#title' =&gt; t('Password Info'),
    '#collapsible' =&gt; TRUE, // Added
    '#collapsed' =&gt; FALSE,  // Added
  );

  $form['fieldset']['current_pass'] = array(
    '#type' =&gt; 'password',
    '#title' =&gt; t('Current password'),
    '#size' =&gt; 25,
    '#required' =&gt; TRUE,
  );

  return $form;
}