Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

0 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