I am building a multi-step form. For one of the steps, I have some required fields. When the user goes back, I'm skipping the validation, but it gets hung up on my required fields. Is there a way to disable or ignore my required fields so my user can go back a step?
Yes, you can use
Used by: button, image_button, submit
Description: Provides an array of sections which are parts of
$form_state['values']which should be validated, implying that sections which are not listed should not be validated.
This is normally used in multistep forms in the case of a "back" button, for example, where
'#limit_validation_errors' => array()would mean not to validate anything as form values on the current page are to be discarded anyway.
#limit_validation_errorsdoes not have any effect if
#submitis not set. More discussion is in the form_set_error() documentation.
Values: array indicating sections of the
$form_state['values']which should be validated.