You are here

public static function WebformAjaxElementTrait::validateAjaxElementCallback in Webform 6.x

Same name and namespace in other branches
  1. 8.5 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 for ajax element 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();
  }
}