FormState::$triggering_element

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Form/FormState.php \Drupal\Core\Form\FormState::triggering_element
  2. 10 core/lib/Drupal/Core/Form/FormState.php \Drupal\Core\Form\FormState::triggering_element
  3. 11.x core/lib/Drupal/Core/Form/FormState.php \Drupal\Core\Form\FormState::triggering_element

The form element that triggered submission.

This may or may not be a button (in the case of Ajax forms). This key is often used to distinguish between various buttons in a submit handler, and is also used in Ajax handlers.

This property is uncacheable.

Type: array|null

File

core/lib/Drupal/Core/Form/FormState.php, line 355

Class

FormState
Stores information about the state of a form.

Namespace

Drupal\Core\Form

Code

protected $triggering_element;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.