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.

help with drop down list

Avatar

Level 1

Hi everyone.

I am trying to create a drop down menu in live cycle where selection in one field automatically fills another text field.

Example  If I select a persons name in drop field "A", their addresss shows up in text field "B".

Also,  The text field "B" should automatically expand to fit all data (an not so that the fonts shrink to fit in the text box)

I also want users to be able to type in a new name, and a new address for each fields.  (i hope i explained it clearly)

6 Replies

Avatar

Level 1

oh, and if I can have multiple lines per drop down item, that would be great, then I dont need

to select the name and have the address pop up.  The name and the address can be a drop down list entry

Avatar

Level 6

Not sure of your form design requirements but it sounds like you need to rethink part of it.

Dependent dropdown lists contain fixed values.

If you select A from list 1, B appears in list 2.  I'm not sure why you need an expanding field and why would you allow editing?

Maybe I just need more info re. what you're trying to design.

Avatar

Level 2

I'm trying to do something very similar.  I need a user to choose an option from a drop-down list, then depending on what they choose, a text field will populate an email address.  Any clues on how to do this?  Thanks!

Avatar

Level 6

Here's a possible solution assuming there is a one to one relationship between the option in your drop down and the email address:

if (xfa.event.newText=="namefromyourlist")
{TextField1.rawValue="emailaddress"
}

if (xfa.event.newText=="name2fromyourlist")
{TextField1.rawValue="emailaddress2"
}

if (xfa.event.newText=="name3fromyourlist")
{TextField1.rawValue="emailaddress3"
}

Create a dropdown list

Add the above script on the drop down list and enter  values (name and email address) for each name on your list

Avatar

Level 2

Thank you!!!  One more question, do I have to add a text field below the drop down list for it to execute the email address?

Avatar

Level 6

yes - in my example the textfield is named textfield1.  You can name it whatever you want