Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Drop downs in LiveCycle Designer

Avatar

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

Avatar

Former Community Member

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