It looks like you're new here. If you want to get involved, click one of these buttons!
I want to have a field change its fill color based on the number of another field. If you were spending points on something and your points hit zero then a field turns yellow. Thanks for any help.
Comments
Here is two ways to do it with Scripts.
First
This variant uses entire field objects as argument to a function
Add the following script to the Script page
And in the source of the field(named txtValueToColor in this example) you want to color, set the follwing
js:ColorValue(txtValueToColor,txtValue)
Another way to do this
This variant adds a document wide function that runs if ANY content in the document gets update. Needless to say, the first variant is to be prefered but sometimes this comes in handy.
Add an event for PostUpdate in Document Setup
Then in add to the Scripts page
Edited 2019-12-02 14:30:00 reason:
Forgot to output value from function ColorValue
Wow,thanks. Your the best.
Your welcome, I made a small update to script, returned value from ColorValue, see post