Using Drop-down to dynamically format separate text field, but target text field doesn't auto update
I'm using Acrobat Pro.
I'm trying to get a text field to dynamically change its fill color according to the selection in a separate dropdown box. The code works, changing options in the dropdown changes the fill color, but it doesn't update unless I edit the text in the target text field, then click on a separate object. I'm hoping to find a solution where changing the value in the dropdown field automatically updates the target text field.
I have tried inputing the script in:
Text Field Properties/Format/ Custom Keystroke Script
as well as:
Text Field Properties/Format/ Custom Format Script
I get the same results.
In the Dropdown Properties menu, I checked the box "Commit Selected value immediately"
I'm not a JavaScript programmer; I just figured out how to do this today.
var f = this.getField("Dropdown1").value; {
if(f=="Option1")
event.target.fillColor = ["RGB", 255/255,255/255,110/255];
else if(f=="Option2")
event.target.fillColor = ["RGB", 110/255,245/255,255/255];
}
Thank you for any help you can offer.