Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Loops through listbox for value, if does not exist, provide a error message.

Avatar

Former Community Member

Hello:

I have a listbox with Profession (text) and Price (value). I am using another field which they type in the profession. if the profession exists, bring back the price, if not, show an error message instead. Has any encountered this or know how I would go about solving scripting this?

My loops looks for the values but if it isnt found, it will just go to the first entry.

1 Reply

Avatar

Former Community Member

FYI, here is my code:

var oArr = [textbox].rawvalue

var oList = xfa.resolveNode([listbox].somExpression);

var oListIndex;

while (oArr.length!=0){

oListIndex = [listbox].boundItem(oArr.pop());

oList.setItemState(oListIndex-0,1);

}