Avatar

Correct answer by
Level 2

Ok. After playing around for a bit I figured it out. I ended up with this script. It will change the numerical field background color based on a positive, negative or neutral value and it will also display the positive/negative sign. With your help radzmar I was able to finish this. Thanks.

var num1 = (xfa.resolveNode("form1.#subform.CurrentWeight[9]").rawValue) - (xfa.resolveNode("form1.#subform.PrevWeight[9]").rawValue)

if (num1 > 0)

{

this.fillColor = "252,194,194";

this.format.picture = "num{'+'zz9.zz} 'lbs.'";

}

else if (num1 < 0)

{

this.fillColor = "194,252,194";

this.format.picture = "num{zz9.zz} 'lbs.'";

}

else if (num1 == 0)

{

this.fillColor = "194,194,252";

}

this.rawValue = num1;

View solution in original post