I created a multistep node form in Drupal7 using the multistep module (http://drupal.org/project/multistep)
I patched the module so it would work (previously Drupal complained about required fields that weren't on the current step). The module is working fine now, the only thing is that if I press the previous button, it still validates the current step. I want to skip this validation, so the current step is only validated if I press the next or done button.
I digged into the module code, but really cannot figure out what to search for.
Can anyone help me on this?
Edit: Here's my form_alter function for multistep:
function multistep_form_alter(&$form, &$form_state) {
if (isset($form['#multistep'])) {
$excluded_children = _multistep_gather_excluded_fieldgroup_children($form, $form['#multistep']['current']);
$current_children = _multistep_gather_current_children($form, $excluded_children);
$prev_excluded_children = _multistep_gather_excluded_fieldgroup_children($form, $form['#multistep']['previous']);
$prev_current_children = _multistep_gather_current_children($form, $prev_excluded_children);
// Apply limit validations to all submit fields.
foreach (element_children($form['actions']) as $key) {
if ($key == 'previous') {
if (isset($form['actions'][$key]['#type']) && $form['actions'][$key]['#type'] == 'submit') {
$form['actions'][$key]['#limit_validation_errors'] = $prev_current_children;
}
}
else {
if (isset($form['actions'][$key]['#type']) && $form['actions'][$key]['#type'] == 'submit') {
$form['actions'][$key]['#limit_validation_errors'] = $current_children;
}
}
}
}
}