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

Drop downs in LiveCycle Designer

trudyw51249318
Level 1
Level 1

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!

1 Reply
Anonymous
Not applicable

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; }