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.

Dropdown to populate textbox with multiple selections

Avatar

Former Community Member
I'm doing a simple form for a process at work and thought it should be really simple. I placed a list-box on the form so as users could make multiple selections (Ctrl+click). Now the business unit has come back saying they want to swap the list box for a drop-down list, and have the drop-down populate a text box with multiple selections (on change or click). I'm not a coder and have looked for something similar but haven't been too lucky in my search.



I picked up the piece of code below which populates the text box, but it always replacs the first seletion with a different selection. Can anyone please help modify this code so it adds mutiple choices to the text box.



SelectedInd.rawValue = xfa.event.newText;



Many regards
4 Replies

Avatar

Former Community Member
send me your form,will fix it for you if possible

thanks

mergeandfuse@gmail.com

Avatar

Former Community Member
if(xfa.event.prevText=="")

{

SelectedCat.rawValue = xfa.event.newText;

}

if(xfa.event.prevText!="")

{

SelectedCat.rawValue = SelectedCat.rawValue+"\n"+xfa.event.newText;

}



this script will work.SelectedCat is the textField which are you are populating

Avatar

Former Community Member
That is excellent, thank you so much.



I'm sure this will be very valuable to a lot of people.



Many regards,



Steve

Avatar

Level 3
Hello,



I'm a new user to Adobe Live Cycle. I have the same problem with a drop down and a text field box.



I have a drop down with multiple selections and have a text field that generates text. I wanted to keep that text but it disappears after the next selection.



I've tried using the code provided above but had no sucess.... I placed the code everywhere I could think of.

change, exit, with the trigger drop down & the text field box.



This is would be awesome if someone could help me with my form.



I have the same problem with Checkboxes.



Mutiple checkboxes with 1 text field. the text never stays after a new checkbox is selected.



Arnold Love

arnoldl0ve@yahoo.com