title: Symfony 2 - Dynamically hide field based on selection in another field
body: <p>I've searched a lot, but can't find the answer to this rather simple question:</p>
  
  <p>In Symfony 2.8 I have a form, that renders a country field. Based on it's selection I want to display a zipcode and federalstate field only for the choice 'Deutschland' (data 'D'). Here is the code for the country-field:</p>
  
  <pre><code>                -&gt;add('nationveranstaltungsort', ChoiceType::class, array(
                      'choices' =&gt; array(
                          'D' =&gt; 'Deutschland',
                          'AFG' =&gt; 'Afghanistan',
  //many other countries following                   
                      ),
                      'data' =&gt; 'D',
                      'label' =&gt; 'Nation Tagungsstätte'))
  </code></pre>
  
  <p>it's prepopulated with the Choice 'Deutschland', data 'D'.</p>
  
  <p>based on that i want to dynamically display: </p>
  
  <pre><code>-&gt;add('plzveranstaltungsort', TextType::class, array('label' =&gt; 'PLZ', 'attr' =&gt; array('size' =&gt; '5', 'maxlength' =&gt; '5')))
                  -&gt;add('bundeslandveranstaltungsort', ChoiceType::class, array(
                      'choices' =&gt; array(
                          0 =&gt; '     ',
                          1 =&gt; 'Baden-Württemberg',
                          2 =&gt; 'Bayern',
                          3 =&gt; 'Berlin',
                          4 =&gt; 'Brandenburg',
                          5 =&gt; 'Bremen',
                          6 =&gt; 'Hamburg',
                          7 =&gt; 'Hessen',
                          8 =&gt; 'Mecklenburg-Vorpommern',
                          10 =&gt; 'Nordrhein-Westfalen',
                          11 =&gt; 'Rheinland-Pfalz',
                          12 =&gt; 'Saarland',
                          13 =&gt; 'Sachsen',
                          14 =&gt; 'Sachsen-Anhalt',
                          15 =&gt; 'Schleswig-Holstein',
                          16 =&gt; 'Thüringen',
                      ),
                      'data' =&gt; 0,
                      'label' =&gt; 'Bundesland Tagungsstätte'))
  </code></pre>
  
  <p>If "Deutschland" is not selected, I simply want to hide/disable these fields (and handle the null value somewhere else).</p>
  
  <p>I tried <a href="http://symfony.com/doc/current/form/dynamic_form_modification.html" rel="nofollow noreferrer">http://symfony.com/doc/current/form/dynamic_form_modification.html</a> and some other javascript stuff, but as I basically don't know any JS, I couldn't find any proper resources.</p>