The send function does not work in a custom form I have a module that creates a form in a block with a template.
But when I press the submit button, it does not execute the submitForm function.
Instead if in the template only {{form}} if you do.

To clarify, in the template the fields are customized and I call them: {{form.date}}, {{form.submit}}

/**
 * {@inheritdoc}
 */
public function getFormId() {
    return 'custom_form';
}

/**
 * {@inheritdoc}
 */
public function buildForm(array $form, FormStateInterface $form_state) {

    $form['name'] = [
        '#type' =&gt; 'textfield',
        '#size' =&gt; 60,
        '#placeholder' =&gt; 'Votre nom',
        '#maxlength' =&gt; 128,
        '#required' =&gt; TRUE,
    ];



    $form['tel'] = [
        '#type' =&gt; 'number',
        '#default_value' =&gt; "",
        '#placeholder' =&gt; 'Votre numéro',
        '#size' =&gt; 20,
        '#maxlength' =&gt; 20,
    ];




    $form['submit'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt; $this-&gt;t('Réserver'),
        '#button_type' =&gt; 'primary',
    );



    return $form;
}


 /**
 * {@inheritdoc}
 */
 public function submitForm(array &amp;$form, FormStateInterface $form_state) {

foreach ($form_state-&gt;getValues() as $key =&gt; $value) {
  drupal_set_message($key . ': ' . $value);
}
 }
You have to write the submit handler for the form to save data.

  /**
   * {@inheritDoc}
   */
  public function submitForm(array &amp;$form, FormStateInterface $form_state) {

    // Insert queries.

    $query = \Drupal::database()-&gt;insert('mymodule_table');
    $query-&gt;fields([
      'name' =&gt; $form_state-&gt;getValue('name'),
      'tel' =&gt; $form_state-&gt;getValue('tel'),
    ]);
    $query-&gt;execute();

  }