You are here

function ajax_forms_test_validation_form_callback in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module \ajax_forms_test_validation_form_callback()

Ajax form callback: Selects the 'drivertext' 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 168
Simpletest mock module for Ajax forms testing.

Code

function ajax_forms_test_validation_form_callback($form, FormStateInterface $form_state) {
  drupal_set_message("ajax_forms_test_validation_form_callback invoked");
  drupal_set_message(t("Callback: drivertext=%drivertext, spare_required_field=%spare_required_field", array(
    '%drivertext' => $form_state
      ->getValue('drivertext'),
    '%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>',
  ];
}