function AutoTextfields::submitForm
File
-
modules/ajax_example/src/Form/AutoTextfields.php, line 103
Class
- AutoTextfields
- Adds more text fields basing on AJAX-enabled checkbox clicks.
Namespace
Drupal\ajax_example\Form
Code
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'),
]));
}