You are here

protected function WebformSubmissionConditionsValidator::validateFormRecursive in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformSubmissionConditionsValidator.php \Drupal\webform\WebformSubmissionConditionsValidator::validateFormRecursive()

Recurse through a form and validate visible elements.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

1 call to WebformSubmissionConditionsValidator::validateFormRecursive()
WebformSubmissionConditionsValidator::validateForm in src/WebformSubmissionConditionsValidator.php

File

src/WebformSubmissionConditionsValidator.php, line 314

Class

WebformSubmissionConditionsValidator
Webform submission conditions (#states) validator.

Namespace

Drupal\webform

Code

protected function validateFormRecursive(array $form, FormStateInterface $form_state) {
  foreach ($form as $key => $element) {
    if (!WebformElementHelper::isElement($element, $key) || !WebformElementHelper::isAccessibleElement($element)) {
      continue;
    }
    $this
      ->validateFormElement($element, $form_state);
    $this
      ->validateFormRecursive($element, $form_state);
  }
}