I have a form with an entity field where you can select multiple provinces. I want to show it like a list, one under another, but this is how it looks now:
And I want that it looks like this:
There is a way I can edit it?
The formType code:
$builder->add('provinces', EntityType::class, array(
'label' => 'Provincias donde actuo',
'required' => true,
'class' => 'CASEventBundle:Province',
'choice_label' => 'name',
'required' => false,
'multiple' => true,
'expanded' => true
));
The twig template:
{{ form_label(form.provinces) }}
<br>
<input type="checkbox" class="selectAllCheckboxes">Seleccionar todos<br>
{{ form_errors(form.provinces) }}
{{ form_widget(form.provinces) }}
<br><br>
Edit: Here is the HTML code that is generated:
<div id="cas_group_profile_provinces" class="claseprov">
<input type="checkbox" id="cas_group_profile_provinces_1" name="cas_group_profile[provinces][]" value="1">
<label for="cas_group_profile_provinces_1">Álava</label>
<input type="checkbox" id="cas_group_profile_provinces_2" name="cas_group_profile[provinces][]" value="2">
<label for="cas_group_profile_provinces_2">Albacete</label>
<input type="checkbox" id="cas_group_profile_provinces_3" name="cas_group_profile[provinces][]" value="3">
<label for="cas_group_profile_provinces_3">Alicante</label>
<input type="checkbox" id="cas_group_profile_provinces_4" name="cas_group_profile[provinces][]" value="4">
<label for="cas_group_profile_provinces_4">Almería</label>
...
</div>

