function Autotextfields::textfieldsCallback

Same name in other branches
  1. 8.x-1.x ajax_example/src/Form/Autotextfields.php \Drupal\ajax_example\Form\Autotextfields::textfieldsCallback()
  2. 4.0.x modules/ajax_example/src/Form/Autotextfields.php \Drupal\ajax_example\Form\AutoTextFields::textfieldsCallback()

Callback for ajax_example_autotextfields.

Selects the piece of the form we want to use as replacement markup and returns it as a form (renderable array).

File

modules/ajax_example/src/Form/Autotextfields.php, line 120

Class

Autotextfields
Show textfields based on AJAX-enabled checkbox clicks.

Namespace

Drupal\ajax_example\Form

Code

public function textfieldsCallback($form, FormStateInterface $form_state) {
    return $form['textfields_container'];
}