0

On my Sonata Admin I have two 'choice' fields.

Options on these list are getted with AJAX.

  1. The first list is classic - 'multiple' & 'extended' to false.
  2. The second has to be 'multiple' & 'extended', and so, create checkboxes.

For the first list, I can add my options with some JS/Jquery ( append('option') ) but I looking for a solution to create the checkboxes of the second list.

Is there any twig helper ou something else to do this?

Thanks for help!

EDIT:

To be more precise, I want to do two dependents fields (and so, dynamically add options on these list)

CyrilleGuimezanes
  • 1,598
  • 1
  • 18
  • 33
  • can you please explain what you mean by "The second has to be 'multiple' & 'extended', and so, create checkboxes." ? – lordrhodos May 12 '16 at 21:42
  • It's the field options. My field is defined as it: ->add('weeks', 'choice',array('required'=> false, 'multiple' => true, 'expanded'=>true, 'mapped' => false)). This configuration create a checkbox group instead of a select – CyrilleGuimezanes May 13 '16 at 07:54
  • This helped me http://stackoverflow.com/questions/3542243/doctrine2-best-way-to-handle-many-to-many-with-extra-columns-in-reference-table – Ophiuchus Jul 05 '16 at 13:20

0 Answers0