You are here

public static function WebformAjaxElementTrait::validateAjaxElementCallback in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Element/WebformAjaxElementTrait.php \Drupal\webform\Element\WebformAjaxElementTrait::validateAjaxElementCallback()

Ajax element validate callback.

Parameters

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

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

File

src/Element/WebformAjaxElementTrait.php, line 157

Class

WebformAjaxElementTrait
Trait class for element Ajax support.

Namespace

Drupal\webform\Element

Code

public static function validateAjaxElementCallback(array $form, FormStateInterface $form_state) {
  $button = $form_state
    ->getTriggeringElement();
  if (empty($button['#limit_validation_errors'])) {
    $form_state
      ->clearErrors();
  }
}