"; var_dump($form_state); echo "\n"; // $form_state['#after_build'][] = 'custom_ab'; } function custom_ab(&$form_state, $form) { echo "
"; var_dump($form_state); echo "\n"; } /** * Implementation of hook_menu(). */ function custom_menu() { $items = array(); $items['custom/form'] = array( 'title' => 'Custom form', 'page callback' => 'drupal_get_form', 'page arguments' => array('custom_form'), 'access arguments' => array('access content'), ); return $items; } function custom_form(&$form_state) { $form['title'] = array( '#type' => 'textfield', '#title' => t('Title'), '#description' => t('The title of this entry.'), '#required' => TRUE, '#input_format' => FILTER_FORMAT_DEFAULT, '#weight' => 200, ); $form['entry'] = array( '#type' => 'textarea', '#title' => t('Your entry'), '#description' => t('Enter something here.'), '#required' => TRUE, '#input_format' => FILTER_FORMAT_DEFAULT, ); $form['what'] = array( '#type' => 'fieldset', '#title' => t('Fieldset 1'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#tree' => TRUE, ); $form['what']['ever'] = array( '#type' => 'fieldset', '#title' => t('Fieldset 2'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['what']['ever']['here'] = array( '#type' => 'textarea', '#title' => t('Your here'), '#description' => t('Enter something here.'), '#required' => TRUE, '#input_format' => FILTER_FORMAT_DEFAULT, ); $form['what']['ever']['hidden'] = array( '#type' => 'textarea', '#title' => t('DON\'T DISPLAY'), '#description' => t('Enter something here.'), '#required' => TRUE, '#input_format' => FILTER_FORMAT_DEFAULT, '#access' => FALSE, // HIDDEN! ); $form['submit'] = array('#type' => 'submit', '#value' => t('Submit')); // $form['#after_build'][] = 'custom_ab'; return $form; } function custom_form_submit($form, &$form_state) { echo "
"; var_dump($form_state); echo "\n"; }