Expand my Community achievements bar.

Multiple Line Drop Down List

Avatar

Former Community Member

Hi!

I need to create a drop down list where the options are really long. I am aware that the "drop down list field" in livecycle do not give you the option for multiple lines. Can I script the values of the drop down list  using FormCalc or Javascript? This way I can hard code where the second line should start.

 

 

6 Replies

Avatar

Level 2

Yes, you can fill a dropdown list with javascript:

MyDropDown.clearItems();

MyDropDown.addItem("Item 1","1");

MyDropDown.addItem("Item 2","2");

etc.

If you want to insert multiple lines, write "\n":

MyDropDown.addItem("This is Item 3\nA very long line containing this option","2");

Avatar

Former Community Member

Thank you for your reply! I am new to this please be patient

Where do I place the code? I have to create the same field 5 times

UnitGoal1

UnitGoal2

UnitGoal3

UnitGoal4

UnitGoal5

Do I place the code in the change event of each field.

Avatar

Level 2

No problem

Yes, you have to repeat the code for each item you want to populate.

You can place the code in the "initialize" event for the form or for the page the list is in. So, when you open the form, the list is already populated and ready to use.

J. Carlos

Avatar

Level 10

Hi,

here's a sample of a "multi-line dropdown" I created once.

https://workspaces.acrobat.com/app.html#d=kvGJ4kTvXaZHj5g6LJpP6Q

A picture is shown in this thread

http://forums.adobe.com/thread/738198

Avatar

Former Community Member

Make the height of the DD big. In the exit of the drop down use this code

::exit

if(this.rawValue == "This is drop down"){

this.rawValue = "This is \n drop down";

}