$form_state['node'] Values Being Lost in Multistep Node Form After Ajax Click I am really hoping someone might have an insight into this really troubling issue. I have got a custom node form which is presented as 4 multistep pages. In my third step, I have a bunch of ajax buttons which allow the user to save information. The problem is, after the ajax button has been clicked and we click the next 'page' button, all the $form_state['node'] values from the previous pages are being lost. So, consequently, when I get to hook_node_insert, I have empty values from the first 3 pages.

However, the weird thing is, this only happens in a couple of my ajax buttons in that page. I have a few other ajax buttons, which, don't cause any such problem. This is the definition for one of the problematic buttons:

&lt;?php
    //Add the cancel button to cancel the "Add New Product" form
    $form['newproduct']['fieldset']['cancel'] = array(
      '#type' =&gt; 'button',
      '#name' =&gt; 'Add New Product Cancel',
      '#value' =&gt; 'Cancel',
      '#ajax' =&gt; array(
        'callback' =&gt; 'MyModule_NewProduct_Cancel_ajax_callback',
        'wrapper' =&gt; 'MyModule_NewProduct_wrapper',
        'method' =&gt; 'replace',
      ),
      '#limit_validation_errors' =&gt; array(),
      '#submit' =&gt; array(),
    );
?&gt;


This is the callback for that button:

&lt;?php
function MyModule_NewProduct_Cancel_ajax_callback($form, &amp;$form_state) {
  //Return the add new product button
  return $form['newproduct']['addnewproduct'];
}
?&gt;


I know that I might not have included enough code to see the full problem, but was wondering if there was any problem with the my ajax button element definition. Would appreciate any help on this. Thank you.

Update!!  - SOLVED - It was a limit_validation_errors problem.  I didn't have that set for my 'next' buttons in hook_form_formid_alter().
You need to add a submit handler that has

$form_state['rebuild'] = TRUE;


Otherwise the form will actually submit, and the form_state values will be purged.