Highlighted

Drop downs in LiveCycle Designer

Avatar

Avatar

trudyw51249318

Avatar

trudyw51249318

trudyw51249318

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

Highlighted

Avatar

Avatar

Jing_Luo

Avatar

Jing_Luo

Jing_Luo

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