title: Symfony2 Form won't submit. Form name not in Request
body: <p>Solution found: I didn't specify a method in my form's builder. adding setMethod("POST") fixed my problem.</p>
  
  <p>I've recently started using Symfony2 (and learning TDD. Guess I don't like it easy) and have been having trouble with my form since this morning. It used to work, but now I can't seem to get a working response.</p>
  
  <p>I managed to pinpoint the error a bit. Symfony gets to a point in the HttpFoundationRequestHandler class where it checks if it should handle the request or not (starting at line 56) and line 59 is where it breaks</p>
  
  <pre><code>} elseif ($request-&gt;request-&gt;has($name) || $request-&gt;files-&gt;has($name)) {
  </code></pre>
  
  <p>So if I'm getting this right, since it can't find the form's name in the Request, it simply ignores it, believing the form was never submitted. What I don't get is how that is possible since the only thing that can cause a page change/refresh is the user pressing the "Submit" button of the form...</p>
  
  <p>If any of you had a suggestion or simple pointers on what my problem could be I'd be very thankful!</p>
  
  <p>Since I'm feeling pretty blind on that one, I'll post below my TrinomeClientVideoUploadForm class and the function inside my Controller that displays and handles the form's request.</p>
  
  <p>This right here if the class I use to build the form:</p>
  
  <pre><code>&lt;?php
  namespace Trinome\WebVideoViewBundle\Model\Forms;
  
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  
  class TrinomeClientVideoUploadForm extends AbstractType
  {
      private $name;
  
      public function __construct( $name = "trinome_client_video_upload" )
      {
          $this-&gt;name = $name;
      }
  
      /**
       * {@inheritdoc}
       */
      public function buildForm( FormBuilderInterface $builder, array $options )
      {
          $builder-&gt;add( "client", "text" )
                  -&gt;add( "video", "file" )
                  -&gt;add( "upload", "submit" );
      }
  
      /**
       * {@inheritdoc}
       */
      public function getName()
      {
          return $this-&gt;name;
      }
  }
  </code></pre>
  
  <p>And this is the function that handles the page in my (only) controller:</p>
  
  <pre><code>/**
   * @Route("/")
   * @Template()
   */
  public function indexAction( Request $request )
  {
      $uploadVideoForm = new UploadVideoFormDataSet();
      $form = $this-&gt;createForm( new TrinomeClientVideoUploadForm(), $uploadVideoForm );
  
      $form-&gt;handleRequest( $request );
  
      if ( $form-&gt;isValid() )
      {
          // It never gets here anyways, so I removed it for this post.
      }
  
      return array(
          "form" =&gt; $form-&gt;createView(),
      );
  }
  </code></pre>
  
  <p>Twig file where I render the Form:</p>
  
  <pre><code>{% extends "@BaseViews/base.html.twig" %}
  
  {% block title %}Outil d'upload vidéo Trinome{% endblock %}
  {% block stylesheets %}
      {% stylesheets '@TrinomeWebVideoViewBundle/Resources/public/css/*' filter='cssrewrite' %}
          &lt;link rel="stylesheet" href="{{ asset_url }}" /&gt;
      {% endstylesheets %}
  {% endblock %}
  
  {% block body %}
      &lt;div id="wrapper"&gt;
          &lt;header&gt;
              {% block header %}
                  {% image '@logo_trinome' %}
                      &lt;img src="{{ asset_url }}" alt="Logo Trinome" /&gt;
                  {% endimage %}
              {% endblock %}
          &lt;/header&gt;
          &lt;div id="content"&gt;
              {% block content %}
                  &lt;h1&gt;Connection&lt;/h1&gt;
                  {{ form( form ) }}
              {% endblock %}
          &lt;/div&gt;
      &lt;/div&gt;
  {% endblock %}
  </code></pre>