How do you change font and background colour based on calculated result
Hi,
Hoping you can help.
I’m trying to get a specific result shown, with a particular font colour and background colour to the text field after adding up a calculation based on radio buttons.
I can do the showing of the specific result (shown below, attached to a text field), but am struggling to go get the colour changes to work…can anyone help?
var nResult = this.getField("Result").value;
if( nResult > 26 ) event.value = “TEXT BLOCK 1. (27-36)";
else if( nResult > 15 ) event.value = “TEXT BLOCK 2. (16-26)";
else event.value = “TEXT BLOCK 3. (0-15)";
Is it something to do with this? event.target.fillColor = color.#FFFFFF : color.#800000;
I can’t work out where to put it so it works…
Huge thanks in advance
![]()
