Javascript - Change fill colour depending on the value in the field
I have been using the forums to help me answer the question above and I have managed to create the code below.
var f = this.getField("Text552").value; {
if (f>=1 && f<=5)
event.target.fillColor = ["RGB",153,204,0];
else if (f>=6 && f<=8)
event.target.fillColor =["RGB",255,204,153];
else if (f>=9 && f<=15)
event.target.fillColor = ["RGB",255,139,61];
else if (f>=16 && f<=25)
event.target.fillColor = ["RGB",214,0,0];
else event.target.fillColor = color.white;
}
Using this code the fill colour changes for values 1-5 and 16-25 but not for the rest. Can anyone suggest what I might be doing wrong?
