I have a form to create a Provider Entity. The provider have a name and a list of products he can provide.
In the form, I want to show all the basics products (stored in DB), and so the user check the different products he can provide.
This is quite easy to do with the EntityType
with multiple and expanded to true.
BUT i want also the user to add a description field of the selected product.
Example : List of products : Vegetables, Meat, Honey... The user check "Vegetables", and then a textfield appear so the user can write "carrots and salads".
I could create a Collection Type with a form entry where there is a select and a text field, but it will looks like :
select your product -- Description field ------------------------- Add new product
And I would prefer a multiple and extended list of all available products (with checkbox) and every time a checkbox is checked, a description fields appear at the bottom of the list.
The thing is I've done it quite easy with basic javascript and php, but I'm riting again my website using Symfony...
Thank for your help !