'multistep', 'access' => TRUE, 'title' => 'multistep', 'callback' => 'drupal_get_form', 'callback arguments' => array('multistep_form')); } return $items; } function multistep_form() { $form_values = $_POST['edit']; $form['#multistep'] = TRUE; $current_step = $form_values['step']++; $form['step'] = array( '#type' => 'hidden', '#value' => $current_step, ); switch ($current_step) { case 1: $form['title'] = array( '#type' => 'textfield', '#title' => t('Title'), ); break; case 2: $form['title'] = array( '#type' => 'hidden', '#value' => $form_values['title'], ); $form['body'] = array( '#type' => 'textarea', '#title' => t('Body'), ); break; case 3: $form['title'] = array( '#type' => 'hidden', '#value' => $form_values['title'], ); $form['body'] = array( '#type' => 'hidden', '#value' => $form_values['body'], ); $form['notes'] = array( '#type' => 'textarea', '#title' => t('Other notes'), '#default_value' => 'Pre-populated with Hello Kitty info.', ); if ($form_values['title'] == 'Hello Kitty') { $form['notes']['#default_value'] = 'Pre-populated with Hello Kitty info.'; } break; default: $form['huh'] = array( '#type' => 'value', '#value' => t('goofy') ); } return $form; }