Multistep form submission fails I'm trying to add multistep form functionality to a node creation form via a form alter. My (abbreviated) code follows:

function mymodule_form_FORM_ID_alter($form, &amp;$form_state)
{
        if (!isset($form_state['storage']['step']))
        {
            $form['actions']['submit']['#submit'][] = 'my_form_submit';     
        } elseif (isset($form_state['storage']['step']) &amp;&amp; $form_state['storage']['step'] == 'step-two')
        {
            $form['foo'] = array(
                '#type' =&gt; 'textfield',
                '#title' =&gt; 'Add foo',
            );
            $form['actions']['#type'] = 'actions';
            $form['actions']['submit'] = array(
                '#type' =&gt; 'submit',
                '#value' =&gt; 'Register',
                '#submit' =&gt; 'step_two_form_submit',
            );
        }
}

function my_form_submit($form, &amp;$form_state)
{
    if (!isset($form_state['storage']['step']))
    {
        $form_state['storage']['step'] = 'step-two';
        $form_state['rebuild'] = TRUE;
    } 
    //so far so good
}

function step_two_form_submit($form, &amp;$form_state)
{
    //This code never runs
    drupal_goto('/');
    dd('step two ran');
    //etc
}


The second step of the form loads as I would expect along with a submit function. The submit callback, however, is never called. Am I making a mistake by nuking the entire $form array? (The $form_state array, which is what I really need to hold onto, remains intact.) I feel like I'm very close but am missing something substantial.
This is actually easier than it looks! :)

Use the one submit callback and in it use a switch or if statement to execute different actions depdending on what step you're on.

function my_form_submit($form, &amp;$form_state) {
  if (!isset($form_state['storage']['step'])) {
    $form_state['storage']['step'] = 'step-two';
    $form_state['rebuild'] = TRUE;
  }
  else if ($form_state['storage']['step'] === 'step-two') {
    // do something awesome for step-two
  }
}


UPDATED

The following is working code I have running in Drupal 6:

  // multistep form
  if (!isset($form_state['storage']['page']) || $form_state['storage']['page'] &lt; 4) {
    $form_state['rebuild'] = TRUE;
    $page = $form_state['storage']['page'];
    $form_state['storage'][$page]['values'] = $form_state['values'];
    $form_state['storage']['page']++;
  }
  // process submit
  else {
    // grab submitted values for each step from storage array
  }


It runs in the only submit handler of a multistep form.

I realize this is Drupal 6 but its close enough, can you try this?