SYMFONY – Display an input according to the value of a drop-down list

I’m learning how to use Symfony and I’m stuck on a form.
I have a drop-down list, and depending on the choice, I would like to display an input.
I have been looking for a solution for more than 4 days, but I can’t find anything, so I come here to ask for your help

When I select "Lycé" in this dropdown list : dropdownList,
I would like to display the input "Lycée" : inputLycee

I know there are FormEvent, but I don’t really understand how it works and how to use JS to show or hide inputs

Thanks for your help =)

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *