Text Field to turn red or black when a variable becomes negative or positive, respectively

I’m having a hard time trying to figure out how to make my text field go from red to black to red, etc based on whether the global variable is positive or negative. I’ve tried like 30 different methods for this (so many different conditions and condition types, numbers, etc), and while some of it works, it still is not perfect. Right now, there is no “OnVariableChange” event trigger on Axure 9 (I’m still in shock this has not yet been a feature developed). How can I attached my file for someone to look at?

You can use the “upload” icon in the message editor here (they don’t use labels, so you have look for a sort of arrow growing out of a box with two little eyes).

There’s no easy way of manipulating widget styles using actions, so I’m afraid you’ll probably need to hack it using a coloured box behind the field in question that you show when the value in the field has dropped below a certain point.

You don’t need to use a variable. Just use “OnTextChange” on the field. Then use an if statement to see if the value on the field is lower than a certain amount, and if it is, show the red background.

If you must have different coloured text in the field, then use the above technique, but with a dynamic panel that contains the two states of the field. Then use the OnTextChange event to populate both fields and flip to the second state of the panel once the value in it drops below the threshold. Having two fields may complicate things later if you want to do other things with the field value though of course.

BTW be not “shocked” at the lack of an OnVariableChange function, for in effect you have it already. If you want to see whether a variable has changed its value, you simply reference the variable :slight_smile: