function ajax_forms_test_validation_form_callback

Same name in other branches
  1. 7.x modules/simpletest/tests/ajax_forms_test.module \ajax_forms_test_validation_form_callback()
  2. 9 core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module \ajax_forms_test_validation_form_callback()
  3. 8.9.x core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module \ajax_forms_test_validation_form_callback()
  4. 11.x core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module \ajax_forms_test_validation_form_callback()

Ajax form callback: Selects the 'driver_text' element of the validation form.

1 string reference to 'ajax_forms_test_validation_form_callback'
AjaxFormsTestValidationForm::buildForm in core/modules/system/tests/modules/ajax_forms_test/src/Form/AjaxFormsTestValidationForm.php
Form constructor.

File

core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module, line 232

Code

function ajax_forms_test_validation_form_callback($form, FormStateInterface $form_state) {
    \Drupal::messenger()->addStatus("ajax_forms_test_validation_form_callback invoked");
    \Drupal::messenger()->addStatus(t("Callback: driver_text=%driver_text, spare_required_field=%spare_required_field", [
        '%driver_text' => $form_state->getValue('driver_text'),
        '%spare_required_field' => $form_state->getValue('spare_required_field'),
    ]));
    return [
        '#markup' => '<div id="message_area">ajax_forms_test_validation_form_callback at ' . date('c') . '</div>',
    ];
}

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