Ctools wizard multistep form: Back button should remember entered data I am building a multistep form using ctools, basically following this approach. Now I want the following behaviour:


user is at step 1
enters data for step 1
clicks continue and gets to step 2
enters data for step 2
clicks back and gets to step 1
sees the data he entered previously (works already)
clicks continue and gets to step 2
sees the data he entered previously (works not yet)


To show the previously entered data after clicking continue, I simply set $form[$name]['#default_value'] with values from $form_state['values'] (with a detour via ctools object cache). So this works already.

The problem is with clicking back: After clicking back, $form_state['values'] does not contain any entered values. So I don't have the values to populate $form[$name]['#default_value'] and this is my current problem.

So I wonder: How can I send entered values with the back button submit?
To get ctools wizard to save values when the user presses the back button, you would have to remove it's '#limit_validation_errors' property that is set by default in ctools_wizard_wrapper(). There is no convenient switch or form_info property to do this so you have to use a form alter hook similar to this:

function test_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if (isset($form_state['wrapper_callback']) &amp;&amp; $form_state['wrapper_callback'] == 'ctools_wizard_wrapper' &amp;&amp; $form_state['form_info']['id'] == 'test_wizard') {
    if (isset($form['buttons']['previous'])) {
      unset($form['buttons']['previous']['#limit_validation_errors']);
    }
  }
}