function Autotextfields::submitForm
Same name in other branches
- 8.x-1.x ajax_example/src/Form/Autotextfields.php \Drupal\ajax_example\Form\Autotextfields::submitForm()
- 4.0.x modules/ajax_example/src/Form/Autotextfields.php \Drupal\ajax_example\Form\AutoTextFields::submitForm()
Overrides FormInterface::submitForm
File
-
modules/
ajax_example/ src/ Form/ Autotextfields.php, line 103
Class
- Autotextfields
- Show textfields based on AJAX-enabled checkbox clicks.
Namespace
Drupal\ajax_example\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->messenger()
->addMessage($this->t('Submit handler: First name: @first_name Last name: @last_name', [
'@first_name' => $form_state->getValue('first_name', 'n/a'),
'@last_name' => $form_state->getValue('last_name', 'n/a'),
]));
}