title: Symfony form: how to know precisely which field cause an error
body: <p>I have to fix an issue on a Symfony form validation, which is composed of 30 sub-form, each of the sub-form is composed of 3 entities, each of the entities has about 20-25 fields. So this single form contains more than 1800 fields :-(.</p>
  <p>At validation, the developper who code this ugly form check it in a single line like this:</p>
  <pre><code>if ($form-&gt;isValid()) {
      [...]
  }
  </code></pre>
  <p>And if form is not valid, in twig Template, he only wrote:</p>
  <pre><code>{{ form_errors(form) }}
  </code></pre>
  <p>So if I load the form with current values, and submit it without any modification, the validation faild with the same Symfony default message repeted twice:</p>
  <blockquote>
  <p>This value should not be blank.</p>
  <p>This value should not be blank.</p>
  </blockquote>
  <p>But I have no idea of which of the 1800+ fields cause the error, and I didn't found how to ask Symfony for a given error, which is the field which cause it.</p>
  <p>How can I know which field has caused the error ?</p>
  <hr />
  <p><em><strong>Edit</strong></em>: I followed Alexander suggestion and:</p>
  <pre><code>$errors = $form-&gt;getErrors() ;
  foreach($errors as $key =&gt; $error) {
      var_dump($error);
  }
  </code></pre>
  <p>Only gives me twice:</p>
  <pre><code>class Symfony\Component\Form\FormError#1750 (3) {
      protected $messageTemplate =&gt; string(31) &quot;This value should not be blank.&quot;
      protected $messageParameters =&gt; array(0) {}
      protected $messagePluralization =&gt; NULL
  }
  </code></pre>
  <p>No clue on where it happens.</p>