title: Show response in modal dialog after form submit drupal 8
body: <p>i want to show a success message in a popup after a form api submission in drupal 8 , i try many solution but i still have no idea, </p>
  
  <p>i was set the form programmatically </p>
  
  <p>if anyone can help men it will be grateful.</p>
  
  <blockquote>
    <p>this is what i did </p>
  </blockquote>
  
  <pre><code>public function buildForm(array $form, FormStateInterface $form_state)
    {
  
      $form['nom'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; t('le nom de candidat:'),
        '#required' =&gt; TRUE,
      );
      $form['prenom'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; t('le prénom de candidat:'),
        '#required' =&gt; TRUE,
      );
      $form['telephone'] = array(
        '#type' =&gt; 'tel',
        '#title' =&gt; t('numéro de telephone'),
      );
    $form['actions']['cancel'] = array(
        '#type' =&gt; 'button',
        '#value' =&gt; t('Retourner à la page précédente'),
        '#prefix' =&gt; '&amp;nbsp; &amp;nbsp; &amp;nbsp;',
        '#attributes' =&gt; array('onClick' =&gt; 'history.go(-1); return true;','style' =&gt; 'width: 36%;'),
        //'#post_render' =&gt; array('change_button_type'),
      );
  
  
  
  
      $form['actions']['cancel']['#attributes']['class'][] = 'btn-danger';
  
      return $form;
    }
  </code></pre>