Good day everyone,

I want to create a select in salesforce which look is similar to html tag optgroup. I want create an option within an option. Is it possible ? If yes, how will I do it ?


  • 2
    HTML tags are also supported in VF so you can try optgroup and then using Javascript remoting or action function you can pass the selected value in controller. – Tushar Sharma Aug 13 '15 at 6:17
  • @TusharSharma This is a good suggestion but the problem is that this strategy doesn't fit my requirements. Do you have any idea how to make it in apex class ? – Hope Aug 13 '15 at 8:37
  • try map<string,List<string>> then in the key part put your label and in value put all your option. it will give you same layout. – Tushar Sharma Aug 13 '15 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.