Skip to main content
Participant
October 12, 2023
Answered

Change colour with dropdown list selection

  • October 12, 2023
  • 1 reply
  • 1973 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 has been closed for replies.
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 

 

1 reply

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

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