function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NBlasgenNBlasgen 

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

NBlasgenNBlasgen

*bump*

 

Guess no one has an idea?

md1md1
This was selected as the best answer