+ Start a Discussion

Any way to add OPTGROUP to dropdown?

I can use new SelectOption('value', 'label') to create many dropdown (<select>) options but how do I create groups around them?  <optgroup> is a fairly common HTML tag and I can't figure out how to make half the list be in one <optgroup> and the 2nd half in another <optgroup> but still part of the same dropdown.


With some luck someone understands what I mean and can point me in the right direction.  Best I can do now is think about how to do it with javascript after the page renders.

Best Answer chosen by Admin (Salesforce Developers) 

All Answers




Guess no one has an idea?

This was selected as the best answer