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
BedrockMission!

Learn More

View all

Sign in to view all badges

Drop downs in LiveCycle Designer

Avatar

Avatar
Validate 1
Level 1
trudyw51249318
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
trudyw51249318
Level 1

Likes

0 likes

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
trudyw51249318
Level 1

07-05-2015

I have two drop downs.  The first drop down has 5 items, the second has 20.  When the user selects a item in the first drop down I only want the second drop down to show 4 of the items.  How do I write a script for that?  Thank you!

Replies

Avatar

Avatar
Validate 1
Level 2
Jing_Luo
Level 2

Likes

2 likes

Total Posts

16 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Jing_Luo
Level 2

Likes

2 likes

Total Posts

16 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
Jing_Luo
Level 2

07-05-2015

I would like to know if it is an item in the first dropdown list corresponding to 4 items of the second.

If yes,you can use array.

1. In the first "exit" event

var alistName = new Array("A","B","C","D");

var alistValue = new Array("1","2","3","4");

var blistName = new Array("AA","BB","CC","DD");

var blistValue = new Array("11","22","33","44");

if(this.rawValue == "A")

 

for(var i=0;i<alistName.length;i++)

 

var name = alistName[i];

var value = alistValue[i];

DropDownList2.addItem(name,value);

 

if(this.rawValue == "B")

 

for(var j=0;j<blistName.length;j++)

 

var bname = blistName[j];

var bvalue = blistValue[j];

DropDownList2.addItem(bname,bvalue);

2. In the first "change" event

if(xfa.event.newText !=this.rawValue){ DropDownList2.rawValue = null; }