title: Dynamically load dropdown
body: <p>I have been searching this issue for quite sometime now. Okay i dynamically load a form to twig in symfony2. Here's the code below:</p>
  
  <pre><code>class NewsType extends AbstractType
  {   
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $formFactory = $builder-&gt;getFormFactory();
  
          $builder
              -&gt;add('title')
              -&gt;add('body')
              -&gt;add('userType', 'choice', array(
              'choices' =&gt; array (
                'CT' =&gt; 'Contract',
                'PT' =&gt; 'Permanent',),))
              -&gt;add('Save', 'submit')   
                   -&gt;getForm()
          ;
  
          $builder-&gt;addEventListener(
          FormEvents::POST_BIND,
          function (FormEvent $event) use ($formFactory) {
  
  
              var_dump($event);
  
              $choices = array("key1" =&gt; "value1", "key2" =&gt; "value2");
  
              $event-&gt;getForm()-&gt;add(
                $formFactory-&gt;createNamed("my_dynamic_field_name", "choice", null, array(
                          "empty_value" =&gt; "Choose an option",
                          "auto_initialize" =&gt; false,
                          "label" =&gt; "My dynamic field: ",
                          "choices" =&gt; $choices
                      )
                  )
              );
  
  
          }
          );
    }
  
      public function getName()
      {
          return 'remove_form_field';
      }
  
      // ...
  }
  </code></pre>
  
  <p>what i want to achieve is that, when the 'userType' dropdown value is selected, an event should trigger and load 'my_dynamic_field_name' dropdown. How could i achieve this? (This is without using the Submit button and when the user select a value from the dropdown the other dropdown should populate)</p>