Skip to main content
New Participant
November 8, 2022
Question

Custom formatting for drop down menu color change.

  • November 8, 2022
  • 1 reply
  • 2678 views

Hi, 

Being a beginner at Javascript and have been looking and searching for the right code. 

I really hope that you can help me.

 

I have created a fillable PDF with a dropdown menus. The dropdowns have 3 options and want each option to result in a color.

This is the script I currently have been working on i'm able to get the color to change for "Complete" but not for "In Progress" or "Not Started"

 

if (event.value=="Complete")

event.target.fillColor = color.green;

else if (event.value=="In_Progress")

event.target.fillColor = color.yellow;

else if (event.value=="Not­_Started")

event.target.fillColor = color.Red;

event.target.fillColor = color.transparent;

 

This topic has been closed for replies.

1 reply

try67
Braniac
November 8, 2022

-It's "color.red", not "color.Red".

-"color.yellow" is a CMYK color, not an RGB one. Try it with an RGB code, instead.

New Participant
November 9, 2022

I changed it to "color.red" still did not work 

ls_rbls
Braniac
November 9, 2022

Is it "In Progress" or "In_Progress"? You have to make sure the string in your code matches the actual value PERFECTLY, including upper/lower-case letters, spaces, etc.


Than you for noting that Try67.

 

In my example  slide I was testing the script with a space instead of the underscore character for those listed items.