Expand my Community achievements bar.

Drop Down list

Avatar

Former Community Member

Hello

                I am working with LiveCycle Designer ES2. I put a Drop down in on a PDF that I am making. When I chose a option on the drop down list I would like it to add an a text field in a spot. How would I do this?

3 Replies

Avatar

Level 7

Not sure what you are asking. If you want your drop down to populate a field the code would be something like:

field1.rawValue = this.rawValue  //field1 is the field you want to populate. You should put this on the exit event.

if you want the text field to take a different value then you would use an if statement such as:

if(this.rawValue == "Boston"){

field1.rawValue = "MA"

}

else

if(this.rawValue == "San Diego"){

field1.rawValue = "CA"

)

I hope this helps

Avatar

Former Community Member

1.JPG

This is what it looks like when I open it in the PDF

.2.JPG

So I would like to change the drop down box and it add an address to that text box below.

I do not see where I would use code to change this. I do apologize I am still learning about this program.

Avatar

Level 7

If you want to change the text in your example that is 1234 Main Street you would need to modify your code. In the example below requires that the address field is a multi line field.

if(this.rawValue == "Reno"){

field1.rawValue = "NV"

addressField.rawValue = "1234 Main Street \n Reno, NV"

}

else

if(this.rawValue == "San Diego"){

field1.rawValue = "CA"

addressField.rawValue = "1234 Main Street \n San Diego, NV"

}