Using the form collection

The symfony form system uses collections to add or remove many to many or many to one doctrine relationships. When showing the form, you can use some javascript / jquery to add and remove entries in the page dynamically.

This software uses the same mechanism also for other applications, e.g. in the adminstration area for list values or membership types:

fIn this form, you can remove a line by clicking on x and add a new line via a link below the table. This is done with some javascript magic, partly embedded in the form components. To also use this for forms with many to ... relationsships. I have written a service supporting this type of behaviour.