function Datetime::processAjaxForm
Form element processing handler for the #ajax form property.
This method is useful for non-input elements that can be used in and outside the context of a form.
Parameters
array $element: An associative array containing the properties of the element.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
array $complete_form: The complete form structure.
Return value
array The processed element.
Overrides RenderElement::processAjaxForm
File
- 
              core/
lib/ Drupal/ Core/ Datetime/ Element/ Datetime.php, line 319  
Class
- Datetime
 - Provides a datetime element.
 
Namespace
Drupal\Core\Datetime\ElementCode
public static function processAjaxForm(&$element, FormStateInterface $form_state, &$complete_form) {
  $element = parent::processAjaxForm($element, $form_state, $complete_form);
  // Copy the #ajax settings to the child elements.
  if (isset($element['#ajax'])) {
    if (isset($element['date'])) {
      $element['date']['#ajax'] = $element['#ajax'];
    }
    if (isset($element['time'])) {
      $element['time']['#ajax'] = $element['#ajax'];
    }
  }
  return $element;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.