I have a multistep webform with required fields. The problem is that when I press the "previous"button in order to go to the page before the validation triggers and does not allow me to change the page. How can I disable the validation if the "previous" button is pressed?
I followed this question but it didnt work by adding this code:
if(isset($form['actions']['wizard_prev'])){
$form['actions']['wizard_prev']['#validate'] = ['::noValidate'];
}
$form['actions']['wizard_prev']['#limit_validation_errors'] = [];
instead.