Technically it's possible, but it's an undocumented feature and it tends to be buggy, so I would not recommend doing it.
I really need to get it done for my organization. Would you kindly recommend the right code/procedure to do it. Please and thanks.
OK, here's the code to achieve it:
this.getField("Dropdown1").setItems(["Item 1", "Item 2\nSecond line of item 2", "Item 3"]);
The second item in the list will have two lines.
Whoa, that line may seem easy to read but I have absolutely no idea how to write it.
Could you give me an example with 2 items, for example:
I really appreciate your help!
Where do you want the line-break(s) to be, though?
And what's the name of the drop-down field?
Then execute this code from the Console window (or even from a button field):
this.getField("Dropdownv1").setItems(["this line is a\ntest line.", "the quick brown fox jumped\nover the lazy dog."]);
The "\n" escape character stands for "line-break", as you can see.
Thank you!! We are almost there, the multi lines began to show up just the way I pictured. Just one problem, when I select the 2nd option from the drop down in preview mode, it automatically selects the first option and doesn't display the 2nd drop down paragraph. Any idea?
No... As I said, it's buggy.