The problem, most likely, is that you don't have an else clause, so once the fill color is set to red it will stay like that forever.
Add this line at the end of your code:
else event.target.fillColor = color.transparent; // or color.white, or whatever color you want to use
Thanks for responding!
I added that line but now it stays as transparent. Still don't know whats wrong.
Change the first line to:
var x = Number(this.getField("fill_35").value);
Tried that line but still no luck
Have you checked the JS Console for errors? Can you share the file in question?
So I tried changing the code to:
var x = getField("fill_35").value
if (x > 0.2)
event.target.fillColor = color.red
event.target.fillColor = color.transparent