This form consists of 1 textfield, and 1 ajax button. The button should add another textfield with each click. - `buildForm` only executes on page load (according to my debug) so manipulating $form with the help of `triggering_element` hasn't been an option as I would expect from D7 experience. - I know the callback code is wrong. It's to communicate where I ended up and what I'm trying to accomplish. Question: How do I accomplish this in Drupal 8? <?php ... class MyModuleForm extends FormBase { ... public function buildForm(array $form, array &$form_state) { $form['foo'] = array( '#type' => 'container', '#tree' => TRUE, '#prefix' => '<div id="foo-replace">', '#suffix' => '</div>' ); $form['foo'][0] = array( '#type' => 'textfield' ); $form['add'] = array( '#type' => 'submit', '#name' => 'add', '#value' => t('Add'), '#ajax' => array( 'callback' => array($this, 'addMore'), 'wrapper' => 'foo-replace', 'effect' => 'fade', ), ); return $form; } public function addMore(array $form, array &$form_state) { $form['foo'][] = array( '#type' => 'textfield' ); return $form['foo']; } }