Hi,
I have the solution for this your problem, using optgroup
the solution is :
You can do this by definig your "select from list" element list like this:
this is needed, at least one option, so the select element get's built on start. We will remove this option by code in the bellow script.
Now go to your select list element> init script> Form entry:
function ff_selectFromListELementName_init(element, condition)
{
element.options[0]= null;
var optG = document.createElement("optgroup");
optG.label = "First Optgroup";
optG.appendChild(new Option('Option1', 'value1', 'none', false, false));
optG.appendChild(new Option('Option2', 'value2', 'none', false, false));
element.appendChild(optG);
optG = document.createElement("optgroup");
optG.label = "Second Optgroup";
optG.appendChild(new Option('Option3', 'value3', 'none', false, false));
optG.appendChild(new Option('Option4', 'value4', 'none', false, false));
element.appendChild(optG);
}
Instead 'selectFromListELementName' insert name of your select list.
If you need more help with creating optgroup, let me know and I will help you.
Let me know!
Regards,
Mirko