Skip to main content
Participant
October 9, 2023
Answered

Change font colors for choices in drop down list on Adobe PDF using Adobe Acrobat Pro.

  • October 9, 2023
  • 1 reply
  • 2108 views

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.

Correct answer Nesa Nurani

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;

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
October 10, 2023

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;
Participant
October 10, 2023

Thank you so much.  Works perfectly!