You are here

public function Select2AutocompleteForm::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/Select2AutocompleteForm.php, line 43

Class

Select2AutocompleteForm
Test form to test the select2 element.

Namespace

Drupal\select2_form_test\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $form_state
    ->setResponse(new JsonResponse($form_state
    ->getValues()));
}