Skip to main content
Participant
October 12, 2023
Answered

Change colour with dropdown list selection

  • October 12, 2023
  • 5 replies
  • 1991 views

Hello 

 

I have a simple Yes or No dropdown list, I want the color of the filed to change to red if no selected. Is there a simple code for that 

 

Thanks for the help

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Nesa Nurani

If you want to change the color of the text when "No" is selected, take a look at this post:

https://community.adobe.com/t5/acrobat-discussions/change-font-colors-for-choices-in-drop-down-list-on-adobe-pdf-using-adobe-acrobat-pro/m-p/14145788#M433283 

 

5 replies

Nesa Nurani
Community Expert
Community Expert
October 13, 2023

Use this as validate script of that dropdown:

event.target.fillColor = event.value == "No" ? color.red : color.white;

 

Participant
October 13, 2023

Hello dear 

 

thanks for the help 

May be I was not precise in my question

the code changes the color of the dropdown menu, I want the "No" answer highligted with a red field color 

 

Thanks very much

try67
Community Expert
Community Expert
October 13, 2023

You can't change the color of a specific item in the drop-down, if that's what you mean.