Help changing font color in text field based on value entered by user
Help! I'm trying to change the font color of a text field based on the value entered by user. I currently have the below code in the custom format tab - the first part works; if the user enters "PLATINUM" in the field, the text changes to gray. But when the user enters "GOLD", it does not change to orange. I also have a custom keystroke script to change the text to upper case.
if(event.value=="PLATINUM")
{
event.target.textColor=color.gray
this.getField("VSC Program").textColor=gray;
}
else if(event.value=="GOLD")
{
event.target.textColor=color.orange
this.getField("VSC Program").textColor=orange;
}
I've also tried this script, and it does not work either:
if(event.value=="PLATINUM") event.target.textColor = color.gray;
else if (event.value=="GOLD") event.target.textColor = color.orange;
else event.target.textColor = color.black;
What am I doing wrong?
Any help is greatly appreciated!
