Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

List all drop down items

Avatar

Level 2

Hi Experts

I am trying to list all the items in dropdown list in livecycle designer form. I have got the items length but I am failed to get each items values.

Attached is the screenshot of my work.

drop.JPG

Thanks in advance

Regards

arl

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

The loop is nearly 100%, you are just missing the var in front of the i, to declare the variable.

// Declare variables

var sDD = null;

var nDD = DropdownList1.length;

// Loop through the dropdown items

for (var i=0; i<nDD; i++) {

     sDD = sDD + DropdownList1.getDisplayItem(i) + ", ";

}

app.alert(sDD);

See an example here for accessing the bound and display values of dropdowns (and Listboxes): http://assure.ly/fYCuQ2.

Niall

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

The loop is nearly 100%, you are just missing the var in front of the i, to declare the variable.

// Declare variables

var sDD = null;

var nDD = DropdownList1.length;

// Loop through the dropdown items

for (var i=0; i<nDD; i++) {

     sDD = sDD + DropdownList1.getDisplayItem(i) + ", ";

}

app.alert(sDD);

See an example here for accessing the bound and display values of dropdowns (and Listboxes): http://assure.ly/fYCuQ2.

Niall