title: Go back button submits the form
body: <p>I'm currently having issues with my user's update form in Symfony.
  It's all working good but when it comes to the button part there is a problem.</p>
  
  <p>In my twig template I got this :</p>
  
  <pre><code>&lt;div&gt;
       &lt;button onClick="window.history.back();"&gt;Go back&lt;/button&gt;
       &lt;button type="submit"&gt;Update&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When I click on the <code>Update</code> button it works and my user is updated but when I click it works too when I click on the <code>Go back</code> button, I'm redirected to the previous page but it sumbits the form.
  I don't want the <code>Go back</code> button to sumbit the form, how can I do that ?</p>
  
  <p>Thanks for your help.</p>
  
  <p>EDIT :
  There is my controller function for the update page </p>
  
  <pre><code>/**
  * @Route("/admin/users/{id}/update", name="usersUpdate", methods={"GET","POST"})
  * @IsGranted("ROLE_ADMIN")
  */
  public function usersUpdate(User $user, Request $request)
  {
      $form = $this-&gt;createForm(RegistrationFormType::class, $user);
      $form-&gt;remove('plainPassword');
      $form-&gt;handleRequest($request);
  
      if ($form-&gt;isSubmitted() &amp;&amp; $form-&gt;isValid()) {
          $entityManager = $this-&gt;getDoctrine()-&gt;getManager();
          $entityManager-&gt;persist($user);
          $entityManager-&gt;flush();
  
          $this-&gt;container-&gt;get('session')-&gt;getFlashBag()-&gt;add('validUpdate', 'L\'utilisateur a été mis a jour.');
          return $this-&gt;redirectToRoute('users');
      }
  
      return $this-&gt;render('admin/users/update.html.twig', [
          'registrationForm' =&gt; $form-&gt;createView()
      ]);
  }
  </code></pre>