Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
12

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

New Here ,
Oct 09, 2023 Oct 09, 2023

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.

TOPICS
Create PDFs , How to , Modern Acrobat , PDF , PDF forms
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Oct 09, 2023 Oct 09, 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;

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2023 Oct 09, 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;
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 10, 2023 Oct 10, 2023
LATEST

Thank you so much.  Works perfectly!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines