Copy link to clipboard
Copied
I created a dropdown choice box in a PDF for with the following choices:
VERY LOW
LOW
MINOR
MODERATE
SERIOUS
HIGH
I would like the font color to change depending on the choice (Green, Green, Blue, Yellow, Orange, Red) from choices above. Can someone provide the script I can use to do this. Thanks in advance.
Copy link to clipboard
Copied
You can use this as 'Validate' script of dropdown field:
if(event.value == "VERY LOW" || event.value == "LOW")
event.target.textColor = color.green;
else if(event.value == "MINOR")
event.target.textColor = color.blue;
else if(event.value == "MODERATE")
event.target.textColor = color.yellow;
else if(event.value == "SERIOUS")
event.target.textColor = ["RGB", 255/255, 136/255, 0/255] ;//orange
else if(event.value == "HIGH")
event.target.textColor = color.red;
When you make a choice it will change to a specific color but if you go and make another choice, while you are choosing all choices will have that same color if it's fine with you leave as it is, but if you wish for them to have black color while selecting use this as 'Mouse Down' action of same dropdown field:
event.target.textColor = color.black;
Copy link to clipboard
Copied
You can use this as 'Validate' script of dropdown field:
if(event.value == "VERY LOW" || event.value == "LOW")
event.target.textColor = color.green;
else if(event.value == "MINOR")
event.target.textColor = color.blue;
else if(event.value == "MODERATE")
event.target.textColor = color.yellow;
else if(event.value == "SERIOUS")
event.target.textColor = ["RGB", 255/255, 136/255, 0/255] ;//orange
else if(event.value == "HIGH")
event.target.textColor = color.red;
When you make a choice it will change to a specific color but if you go and make another choice, while you are choosing all choices will have that same color if it's fine with you leave as it is, but if you wish for them to have black color while selecting use this as 'Mouse Down' action of same dropdown field:
event.target.textColor = color.black;
Copy link to clipboard
Copied
Thank you so much. Works perfectly!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now