You are here

public static function WebformValidateConstraint::formSubmitPervious in Webform Validation 8

Same name and namespace in other branches
  1. 2.0.x src/Validate/WebformValidateConstraint.php \Drupal\webform_validation\Validate\WebformValidateConstraint::formSubmitPervious()

Go previous page.

Parameters

array $form: The form array.

\Drupal\Core\Form\FormStateInterface $formState: The form state.

File

src/Validate/WebformValidateConstraint.php, line 435

Class

WebformValidateConstraint
Form API callback. Validate element value.

Namespace

Drupal\webform_validation\Validate

Code

public static function formSubmitPervious(array &$form, FormStateInterface $formState) : void {
  $storage = $formState
    ->getStorage();
  $visitedElements = !empty($storage['visited']) ? $storage['visited'] : [];
  self::formElementUnset($form['elements'], $formState, $visitedElements);
  $storage['visited'] = $visitedElements;
  $formState
    ->setStorage($storage);
}