[Forminator Pro] Using OPTGROUP tag in single choice field for Select Dropdown

Is there a way to group my options within a select element using the Select Dropdown - Single Choice Field in the Forminator Pro plugin?
I would like to create a select field that works like this:

<select>
  <optgroup label="Group 1">
    <option>Option 1.1</option>
  </optgroup>
  <optgroup label="Group 2">
    <option>Option 2.1</option>
    <option>Option 2.2</option>
  </optgroup>
</select>
  • Predrag Dubajic

    Hi Sergio,

    Hope you're doing well :slight_smile:

    There's currently no way of grouping elements like that but if I understand your request properly you should be able to configure this by using conditional logic.

    For example, you can have three groups:
    - Group 1 - Has options O1and O2
    - Group 2 - Has options O1.1 and O1.2, and will display only if O1 is selected in Group 1
    - Group 3 - Has options O2.1 and O2.2 , and will display only if O2 is selected in Group 1

    In order to do this you will need to add three Single Choice fields.
    In first one create options 1 and 2.
    In second one create options 1.1 and 1.2 and then switch to Advanced tab and enable Conditional Logic where you can select this option to show only if Option 1 in Group 1 is selected.
    Repeat same with the third one and select condition for Option 2 in Group one.
    It would look something like this:

    Is this something that will do the trick for you?

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.