Why my button element don't trigger the submitForm method? I have a form with a &lt;button&gt; element

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $form['address'] = array(
      '#type' =&gt; 'textfield',
      '#autocomplete_route_name' =&gt; 'geocoder_autocomplete.autocomplete',
      '#title' =&gt; '&lt;span&gt;' . t('Find an adoration place') . '&lt;/span&gt;',
    );

    $form['submit'] = [
      '#type' =&gt; 'inline_template',
      '#template' =&gt; '&lt;button type="submit" class="glyphicon glyphicon-search"&gt;&lt;/button&gt;',
    ];

    return $form;
  }


When I click the button the page is refreshed but the submitForm() method is not called. If I add an &lt;input type='button'&gt; element in the form and I click the &lt;button&gt; or the &lt;input type='button'&gt; the submitForm() is called.

  public function buildForm(array $form, FormStateInterface $form_state) {
    $form['address'] = array(
      '#type' =&gt; 'textfield',
      '#autocomplete_route_name' =&gt; 'geocoder_autocomplete.autocomplete',
      '#title' =&gt; '&lt;span&gt;' . t('Find an adoration place') . '&lt;/span&gt;',
    );

    $form['submit'] = [
      '#type' =&gt; 'inline_template',
      '#template' =&gt; '&lt;button type="submit" class="glyphicon glyphicon-search"&gt;&lt;/button&gt;',
    ];

    $form['submit1'] = [
      '#type' =&gt; 'submit',
      '#value' =&gt; $this-&gt;t('Submit'),
    ];

    return $form;
  }


I'm missing something here? Why my button element don't trigger the submitForm method?
Your first "submit" button doesn't get recognized by Drupal as a button because you use an inline template.

If you want to add a class on your button use:

$form['submit'] = [
  '#type' =&gt; 'submit',
  '#value' =&gt; $this-&gt;t('Submit'),
  '#attributes'=&gt; ['class'=&gt;['glyphicon', 'glyphicon-search']],
];