function AjaxAddRemoveElements::addmoreCallback

Same name and namespace in other branches
  1. 4.0.x modules/form_api_example/src/Form/AjaxAddRemoveElements.php \Drupal\form_api_example\Form\AjaxAddRemoveElements::addmoreCallback()

Callback for both ajax-enabled buttons.

Selects and returns the fieldset with the names in it.

File

modules/form_api_example/src/Form/AjaxAddRemoveElements.php, line 122

Class

AjaxAddRemoveElements
Example ajax add remove buttons.

Namespace

Drupal\form_api_example\Form

Code

public function addmoreCallback(array &$form, FormStateInterface $form_state) {
    return $form['names_fieldset'];
}