Changing Text Color Based On Value
Copy link to clipboard
Copied
Hello! I've got a drop down box with only 2 options - Pass or Fail. I would like for Pass to be green when selected and Fail to be red.
I can't get any script to work for me.
Anyone that can help me I would greatly appreciate it.
Thanks,
David
Copy link to clipboard
Copied
You can change the fill color of the field based on the selection made in it, but it will affect all the items in it. You can't assign a unique color for each item in it.
Copy link to clipboard
Copied
You can select a color for different items based off of a script. I'm needing some help with creating a script. Which was what I thought I made clear in the first post.
Copy link to clipboard
Copied
You can set the fill color for the field as a whole. It will look like this, though:
If that's OK with you, use this code as the field's custom validation script (and make sure to tick the option to commit the selected value immediately):
if (event.value=="Pass") event.target.fillColor = color.green;
else if (event.value=="Fail") event.target.fillColor = color.red;
else event.target.fillColor = color.white;

