public function Select2AjaxForm::submitForm in Select 2 8
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormInterface::submitForm
File
- tests/
modules/ select2_form_test/ src/ Form/ Select2AjaxForm.php, line 80
Class
- Select2AjaxForm
- Test form to test the select2 element.
Namespace
Drupal\select2_form_test\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$form_state
->setResponse(new JsonResponse($form_state
->getValues()));
}