Skip to main content
Participant
Oct 12, 2023 4:12 AM UTC
Answered

Change colour with dropdown list selection

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.
Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
Oct 13, 2023 10:48 AM UTC

5 replies

Nesa Nurani
Community Expert
Community Expert
Oct 13, 2023 4:25 AM UTC

Use this as validate script of that dropdown:

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

 

Translate
Participant
Oct 13, 2023 7:13 AM UTC

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

Translate
try67
Community Expert
Community Expert
Oct 13, 2023 9:31 AM UTC

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

Translate