I'm looking for help to display a part on my database according to my previous choices in the select buttons : <p>i study the web developpement and i'm actually stuck with a problem.</p>

<p>I have two select buttons in which my database is displayed, the concern being that I would like the second select button to display only the results based on the first one. A bit like if the first button select would have inside "Numbers" and "Letters" and the second in consequences would have inside "1" "2" "3" if in the first select button we choose "Numbers" and "a" "b" "c" if we choose "Letters". I currently only have the full display of my entire database in the second and it does not do the sorting. </p>

<p>I tried a lot of thing but not realy working this is why i come here to have some help or tips.</p>

<p>I'm currently working with symfony 3.4 and on ubuntu.</p>

<p>Here is the code for my first select button:</p>

<pre><code>&lt;select id="sel1" class="formDevis" &gt;
                            &lt;option&gt; Cliquez pour choisir &lt;/option&gt;
                        {% for categorie in categories %}
                            &lt;option&gt;{{ categorie.nomCategories }} 
                            &lt;/option&gt;
                        {% endfor %}
&lt;/select&gt;
</code></pre>

<p>Then this is the code for the second select button:</p>

<pre><code>&lt;select id="prod1" class="formDevis"&gt;
                            &lt;option&gt; Cliquez pour choisir &lt;/option&gt;
                            &lt;option&gt;Non spécifié&lt;/option&gt;
                            {% for produit in produits %}
                                &lt;option&gt;{{ produit.nomProduits }} 
                                &lt;/option&gt;
                            {% endfor %}
&lt;/select&gt;
</code></pre>

<p>And finaly here is the code i use in my controller:</p>

<pre><code>/**
     * Lists all devis entities.
     *
     * @Route("/", name="admin_devis_index")
     * @Method("GET")
     */
    public function indexAction()
    {
        $em = $this-&gt;getDoctrine()-&gt;getManager();

        $devis = $em-&gt;getRepository('DevisBundle:Devis')-&gt;findAll();
        $produits = $em-&gt;getRepository('DevisBundle:Produits')-&gt;findAll();
        $categories = $em-&gt;getRepository('DevisBundle:Categories')-&gt;findAll();


        return $this-&gt;render('categories/devis.html.twig', array(
            'produits' =&gt; $produits,
            'devis' =&gt; $devis,
            'categories' =&gt; $categories
        ));
    }
</code></pre>

<p>I tried to have on the second button select the display of my database according to the first button select but I managed to have the complete display.</p>
