function ajax_forms_test_validation_form_callback in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module \ajax_forms_test_validation_form_callback()
- 7 modules/simpletest/tests/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 212 - Simpletest mock module for Ajax forms testing.
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: drivertext=%drivertext, spare_required_field=%spare_required_field", [
'%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>',
];
}