how do I organize the input fields in fieldset? I have a node form in Drupal 7, in order to simplify it for the user I want to break it up into sections using the vertical tabs feature.

Using hook_form_FORMID_alter() I can move the fields with difficulty.tha following is my code.:

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'test_node_form') {     
    $form['cpmonth'] = array(
      '#type' =&gt; 'fieldset',
      '#title' =&gt; t('test'),
      '#weight' =&gt; 5,
      '#collapsible' =&gt; TRUE,
    );
$form['cpmonth']['field-14sq']=array();
$form['cpmonth']['field-510sq']=array();


  }

}


"field-14sq" and "field-510sq" are my input text fields. Do you have any idea?
If I understand correctly you want to move existing form elements into the fieldset you created.  Try this, I'm assuming the fields you want to move are $form['field-14sq'] and $form['field-510sq']

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'test_node_form') {     
    $form['cpmonth'] = array(
      '#type' =&gt; 'fieldset',
      '#title' =&gt; t('test'),
      '#weight' =&gt; 5,
      '#collapsible' =&gt; TRUE,
    );
    $form['cpmonth']['field-14sq'] = $form['field-14sq'];
    unset($form['field-14sq']);
    $form['cpmonth']['field-510sq'] = $form['field-510sq'];
    unset($form['field-510sq']);
  }
}


If you have custom submit and validation functions this shouldn't affect them, since fields in fieldsets still come back in the root level of $form_state['values'] .