title: Symfony : Dynamic add select box ( Add Dynamically select Language )
body: <p>I'm searching how to implement a system of choosing languages dynamically using <strong>form builder</strong>.</p>
  
  <p><img src="https://i.stack.imgur.com/LY6ZO.png" alt="Form example"></p>
  
  <p>so we must have two html array inputs field : name="languages[]" and the second will be name="languges_level[]"</p>
  
  <p>So this system allows the user to set the language which he can speak with his level on it. </p>
  
  <p>The User can add/remove Language dynamically before he submits the Form.</p>
  
  <p>The Questions :</p>
  
  <p>1- Form Level : what will be the field form type? I have to add 2 form fields which will be combined to create my result array which will be stored in the database. So this two field will be not mapped with ORM.</p>
  
  <pre><code>-&gt;add('langues', TYPEXXX:class) 
  -&gt;add('langues_level', TYPEXXX:class)
  </code></pre>
  
  <p>3- Twig Level: should i make some change in the twig as well?</p>
  
  <p>So what will be the best solution in my case?</p>
  
  <p>My first try is :</p>
  
  <pre><code>-&gt;add('languages', CollectionType::class, array(
      'entry_type'   =&gt; ChoiceType::class,
      'entry_options'  =&gt; array(
          'choices'  =&gt; array(
                          'Français' =&gt; 'Français',
                          'English'     =&gt; 'English',
                          'Italien'    =&gt; 'Italien',
                          'Espanish'    =&gt; 'Espanish',
          ),
          'label'      =&gt; ' ',
      ),
  ))
  -&gt;add('language_levels', CollectionType::class, array(
      'entry_type'   =&gt; ChoiceType::class,
      'entry_options'  =&gt; array(
          'choices'  =&gt; array(
                          'Beginner' =&gt; 'Beginner',
                          'Medium'     =&gt; 'Medium',
                          'Good'    =&gt; 'Good',
          ),
          'label'      =&gt; ' ',
      ),
  ));
  </code></pre>
  
  <p>but this don't work as I mentioned in the picture .. who had a perfect solution plz ?</p>