Expand my Community achievements bar.

SOLVED

Livecycle: How do you Select from a drop down list and populate a text field.

Avatar

Former Community Member

I have a PDF on Adobe livecycle 8.0 that if selected will auto populate the field box:

GoalDropDownList: has items:

     Disability

     Functional

     Impairment

I would like when Disability is chosen that GoalTextField to show:

     Patient will return to previous level of function.

When Functional is chosen GoalTextField to SHow

     Patient able to stand for 5 minutes

WHen Impairment is chosen GoalTextField to Show

     Patient has full range of motion

Any help would be appreciated.

I'm new so can you include in java script where it should be exit, enter, etc.

Thanks everyone.

By the way I'm not sure how to show a picture of this to illustrate it anyone know how?

1 Accepted Solution

Avatar

Correct answer by
Level 2

Write the following javascript code for the drop down list in the change event.

var

selectedValue=xfa.event.newText;

if

(selectedValue=="Disability")

TextField1.rawValue

="Patient will return to previous level of function.";

else

if(selectedValue=="Functional")

TextField1.rawValue

="Patient able to stand for 5 minutes.";

else

TextField1.rawValue

="Patient has full range of motion";

Thanks.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 2

Write the following javascript code for the drop down list in the change event.

var

selectedValue=xfa.event.newText;

if

(selectedValue=="Disability")

TextField1.rawValue

="Patient will return to previous level of function.";

else

if(selectedValue=="Functional")

TextField1.rawValue

="Patient able to stand for 5 minutes.";

else

TextField1.rawValue

="Patient has full range of motion";

Thanks.

Avatar

Level 3

Is it possible to use something similar in a more general case?

I would like to use the idex of the selected item in the drop-down to index into an array.

Any ideas? Thanks!

Avatar

Level 2

first drag and drop the drop down and add the list items under the field.

then in the exit event of the dropdown define the set of code.

var

arr=new Array();

arr[0]

="Patient will return to previous level of function.";

arr[1]

="Patient able to stand for 5 minutes";

arr[2]

="Patient has full range of motion";

app.alert(arr[this.selectedIndex]);

regards,