I have a form with checkboxes loaded from the database (I use the field type of the object). Flags are regions and areas. I have the following database schema:
+-----------------------------------+ | id | parent_id | name | +-----------------------------------+ | 1 | NULL | Region | +-----------------------------------+ | 2 | 1 | District | +-----------------------------------+ | 3 | 1 | Another district | +-----------------------------------+ | 4 | NULL | Another region | +-----------------------------------+ | 5 | 4 | Next district | +-----------------------------------+
The problem is that I need the following form. How to do it?
<b>Region</b> <input type="checkbox" id="someId" value="3"><label for="someId">Another district</label> <input type="checkbox" id="someId" value="2"><label for="someId">District</label> <b>Another region</b> <input type="checkbox" id="someId" value="5"><label for="someId">Next district</label>
forms symfony doctrine2 symfony-forms
kuboslav
source share