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.

Populate multiple items to a text field from a dropdown list

Avatar

Level 1

I am trying to create a dropdown list that when I select an item from the list it adds the item into a text box but doesn't delete the previous text box item.  I am just struggling with how to get the text field to concatenate and not simply replace the existing data with the new.  I thought it might be something I could do with action builder but it doesn't seem possible with out additional scripting.

4 Replies

Avatar

Level 7

Try this code on the exit event of your dropdown list:

tfList.rawValue = tfList.rawValue + " " + this.rawValue;

I'm presuming that the list you're adding items to is called tflist. If it doesn't work, let us know.

Avatar

Level 1

Thanks that worked!  But how do I suppress it from displaying Null as the first response?

Avatar

Level 7

if (tfList.isNull) tfList.rawValue = this.rawValue;

else tfList.rawValue = tfList.rawValue + " " + this.rawValue;