title: Symfony 3 form errors not showing in twig template
body: <p>I am debugging a form i have created in symfony3 with twig as template engine. For some reason if i use {{ form_errors(form) }} (which should return all errors of the form) i only get partial result (some errors are not shown in the message box). </p>
  
  <p>The interesting part comes in when i look into symfony3 debug panel, i can see all those errors showing there: some are on the form level (those 6 i can see in my twig template) and some on the form level (those 2 i cannot see on the form level) <a href="https://i.stack.imgur.com/thKlJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/thKlJ.png" alt="enter image description here"></a></p>
  
  <p>My question is: how do i move phone and gender level errors from field level to form level (or vice versa) and how come some errors are shown at form level and some at field level.</p>
  
  <p>This is my FormType</p>
  
  <pre><code>    &lt;?php
  namespace AppBundle\Form;
  
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\OptionsResolver\OptionsResolver;
  use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  use Symfony\Component\Form\Extension\Core\Type\TextType;
  use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  use Symfony\Component\Form\Extension\Core\Type\EmailType;
  
  class SubscriberType extends AbstractType {
      /**
       * @param FormBuilderInterface $builder
       * @param array                $options
       */
      public function buildForm(FormBuilderInterface $builder, array $options) {
  
          $builder
              -&gt;add('firstname', null, array(
                  'label' =&gt; false,
                  'required' =&gt; true,
                  'attr' =&gt; array(
                      'placeholder' =&gt; 'First Name',
                      'class' =&gt; 'form-field-set'
                  )))
              -&gt;add('lastname', null, array(
                  'label' =&gt; false,
                  'required' =&gt; true,
                  'attr' =&gt; array(
                      'placeholder' =&gt; 'Last Name',
                      'class' =&gt; 'form-field-set'
                  )))
              -&gt;add('emailaddress', EmailType::class, array(
                  'label' =&gt; false,
                  'required' =&gt; true,
                  'attr' =&gt; array(
                      'placeholder' =&gt; 'Email Address',
                      'pattern'     =&gt; '.{2,}', //minlength
                      'class' =&gt; 'form-field-set'
                  )))  
              -&gt;add('phone', TextType::class, array(
                  'label' =&gt; false,
                  'required' =&gt; true,
                  'attr' =&gt; array(
                      'placeholder' =&gt; 'Mobile Phone',
                      'pattern'     =&gt; '.{2,}', //minlength
                      'class' =&gt; 'form-field-set'
                  )))
              -&gt;add('gender', ChoiceType::class, array(
                  'choices' =&gt; array('Male' =&gt; 1, 'Female' =&gt; 2, 'Refuce to answer' =&gt; 0),
                  'label' =&gt; false,
                  'required' =&gt; true,
                  'placeholder' =&gt; 'Gender',
                  'attr' =&gt; array(
                      'class' =&gt; 'form-field-set'
                  )))
              -&gt;add('agreeterms', CheckboxType::class, array(
                  'label' =&gt; '',
                  'required' =&gt; true))
              -&gt;add('agreeemails', CheckboxType::class, array(
                  'label' =&gt; '',
                  'required' =&gt; true))
              -&gt;add('agreepartners', CheckboxType::class, array(
                  'label' =&gt; '',
                  'required' =&gt; true))
              -&gt;add('submit', SubmitType::class, array(
                  'label' =&gt; 'Sign Up', 
                  'attr' =&gt; array(
                      'class' =&gt; 'sub-btn'
                  )))
               ;
      }
  
      /**
      * @param OptionsResolverInterface $resolver
      */
      public function configureOptions(OptionsResolver $resolver) {
          $resolver-&gt;setDefaults(array(
              'data_class' =&gt; 'AppBundle\Entity\Subscriber'
          ));
      }
      /**
       * @return string
       */
      public function getName() {
          return 'subscriber';
      }
  }
  </code></pre>
  
  <p>and this is my Entity</p>
  
  <pre><code>&lt;?php
  
  namespace AppBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  use Symfony\Component\Validator\Constraints as Assert;
  use DateTime;
  
  /**
   * Subscriber
   *
   * @ORM\Entity(repositoryClass="AppBundle\Repository\SubscriberRepository")
   * @ORM\Table(name="MediaBay_Master", uniqueConstraints={@ORM\UniqueConstraint(name="subscriber_pkey", columns={"id"})})
   */
  class Subscriber
  {
      /**
       * @var int
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      /**
       * @var string
       * 
       * @Assert\NotBlank (message="Complete First Name field")
       * @ORM\Column(name="first_name", type="string", length=255, nullable=false)
       */
      private $firstName;
  
      /**
       * @var string
       * 
       * @Assert\NotBlank (message="Complete Last Name field")
       * @ORM\Column(name="last_name", type="string", length=50, nullable=false)
       */
      private $lastName;
  
      /**
       * @var string
       * 
       * @Assert\NotBlank (message="Complete Email Address field")
       * @ORM\Column(name="email_address", type="string", length=100, nullable=false)
       * @Assert\Email(
       *     message = "The email '{{ value }}' is not a valid email.",
       *     checkMX = true,
       *     checkHost = true
       * )
       */
      private $emailAddress;
  
      /**
       * @var string
       * 
       * @Assert\NotBlank (message="Complete Mobile Phone field")
       * @Assert\Length(min=5) (message="Phone lenght must be over 5 characters")
       * @ORM\Column(name="phone", type="string", length=50, nullable=false)
       */
      private $phone;
  
      /**
       * @var int
       * @Assert\GreaterThanOrEqual("18")
       * @ORM\Column(name="age", type="smallint", nullable=true)
       */
      private $age;
  
      /**
       * @var int
       *
       * @Assert\NotBlank (message="Complete Gender field")
       * @ORM\Column(name="gender", type="smallint", nullable=false)
       */
      private $gender;
  
      /**
       * @var int
       * @ORM\Column(name="education_level_id", type="smallint", nullable=true)
       */
      private $educationLevelId;
  
      /**
       * @var int
       *
       * @ORM\Column(name="resource_id", type="smallint")
       */
      private $resourceId;
  
      /**
       * @var bool
       * @Assert\NotBlank (message ="Please select this field")
       * @ORM\Column(name="agree_terms", type="boolean")
       */
      private $agreeTerms;
  
      /**
       * @var bool
       * @Assert\NotBlank (message ="please select this field")
       * @ORM\Column(name="agree_emails", type="boolean")
       */
      private $agreeEmails;
  
      /**
       * @var bool
       * @Assert\NotBlank (message ="please select this field")
       * @ORM\Column(name="agree_partners", type="boolean", nullable=true)
       */
      private $agreePartners;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="subscription_date", type="datetime")
       */
      private $subscriptionDate;
  
      /**
       * @var string
       *
       * @ORM\Column(name="subscription_ip", type="string", length=50)
       */
      private $subscriptionIp;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="unsubscription_date", type="datetime", nullable=true)
       */
      private $unsubscriptionDate;
  
      /**
       * @var string
       *
       * @ORM\Column(name="unsubscription_ip", type="string", length=50, nullable=true)
       */
      private $unsubscriptionIp;
  
      /**
       * @var string
       *
       * @ORM\Column(name="continent_code", type="string", length=2, nullable=true)
       */
      private $continentCode;
  
      /**
       * @var string
       *
       * @ORM\Column(name="country_name", type="string", length=59, nullable=true)
       */
      private $countryName;
  
      /**
       * @var string
       *
       * @ORM\Column(name="region", type="string", length=255, nullable=true)
       */
      private $region;
  
      /**
       * @var string
       *
       * @ORM\Column(name="city", type="string", length=255, nullable=true)
       */
      private $city;
  
      /**
       * @var string
       *
       * @ORM\Column(name="postal_code", type="string", length=50, nullable=true)
       */
      private $postalCode;
  
      /**
       * @var string
       *
       * @ORM\Column(name="latitude", type="string", length=50, nullable=true)
       */
      private $latitude;
  
      /**
       * @var string
       *
       * @ORM\Column(name="longitude", type="string", length=50, nullable=true)
       */
      private $longitude;
  
      /**
       * @var string
       *
       * @ORM\Column(name="dma_code", type="string", length=50, nullable=true)
       */
      private $dmaCode;
  
      /**
       * @var string
       *
       * @ORM\Column(name="area_code", type="string", length=50, nullable=true)
       */
      private $areaCode;
  
      /**
       * @var string
       *
       * @ORM\Column(name="hash", type="string", length=255)
       */
      private $hash;
  </code></pre>
  
  <p>}</p>
  
  <p>these are some of the resource i have already been through but they do not quite answer the question of why some errors are shown on form level and some on field level:</p>
  
  <p><a href="https://stackoverflow.com/questions/33888985/form-errorsform-not-showing-any-errors-in-symfony-twig">form_errors(form) not showing any errors in Symfony Twig</a></p>
  
  <p><a href="https://stackoverflow.com/questions/6996199/get-global-form-errors-from-the-formview-in-twig-template">Get global form errors from the FormView in twig template</a></p>
  
  <p>this is my twig temaplte:</p>
  
  <pre><code>&lt;div class="window-BG" id="alert"&gt;
      &lt;div class="window"&gt;
          &lt;div id="alert-title" class="win-img-text"&gt;{{ 'Please solve below errors'|trans }}:&lt;/div&gt;
          &lt;div id="alert-text" class="win-text"&gt;
              {% if error %}
                  &lt;ul&gt;
                      &lt;li&gt;
                          {{ 'please check if you wrote correct data'|trans }}
                      &lt;/li&gt;
                  &lt;/ul&gt;
              {% endif %}
              &lt;div style="color: white"&gt;
                 {{ form_errors(form) }}
              &lt;/div&gt;    
          &lt;/div&gt;
          &lt;div class="window-close win-close-2"&gt;{{ 'Close'|trans }}&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When using {{ form_errors(form) }} it brings up form level errors (6 of those)</p>
  
  <p>I have also tried including each of the error field separately (please see below) but that only brings field level errors:</p>
  
  <pre><code>&lt;div class="window-BG" id="alert"&gt;
          &lt;div class="window"&gt;
              &lt;div id="alert-title" class="win-img-text"&gt;{{ 'Please solve below errors'|trans }}:&lt;/div&gt;
              &lt;div id="alert-text" class="win-text"&gt;
                  {% if error %}
                      &lt;ul&gt;
                          &lt;li&gt;
                              {{ 'please check if you wrote correct data'|trans }}
                          &lt;/li&gt;
                      &lt;/ul&gt;
                  {% endif %}
                  &lt;div style="color: white"&gt;
                      {{ form_errors(form.firstname) }}
                      {{ form_errors(form.lastname) }}
                      {{ form_errors(form.emailaddress) }}
                      {{ form_errors(form.phone) }}
                      {{ form_errors(form.gender) }}
                      {{ form_errors(form.agreeterms) }}
                      {{ form_errors(form.agreeemails) }}
                      {{ form_errors(form.agreepartners) }}
                  &lt;/div&gt;    
              &lt;/div&gt;
              &lt;div class="window-close win-close-2"&gt;{{ 'Close'|trans }}&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I have also tried 
  Any advice will be highly appreciated</p>