I'm trying to change the color of a total field on an Add screen. I use the Jscript onload event and everything works fine except I cannot get the color to change based on the value.
Here is part my code:
var gtotal = (Number(va1))+(Number(va2))+(Number(va3))+(Number(va4))+(Number(va5))+ (Number(va6))+ (Number(va7))+ (Number(va8))+ (Number(va9))+ (Number(va10))+ (Number(va11))+ (Number(va12))+ (Number(va13))+ (Number(va14))+(Number(va15))+ (Number(va16))+ (Number(va17))+ (Number(va18))+ (Number(va19))+ (Number(va20));
ctrlTotal.setValue(gtotal) ; // adds total points from Var Va1-20
if (ctrlTotal.getValue() >79) { pf.setValue("Pass" );
}
else
{
pf.setValue("Fail");
That part works great but I would like to have "Pass" turn the font Green and abd "Fail" turn it Red. I've tried various things but nothing seems to work. Any ideas or insperation would be great. I have already looked at the conditional formatting but it is in PHP and I need this to to be in Jscript since it changes on the fly with the value change.
Thanks in advanced
Here is part my code:
var gtotal = (Number(va1))+(Number(va2))+(Number(va3))+(Number(va4))+(Number(va5))+ (Number(va6))+ (Number(va7))+ (Number(va8))+ (Number(va9))+ (Number(va10))+ (Number(va11))+ (Number(va12))+ (Number(va13))+ (Number(va14))+(Number(va15))+ (Number(va16))+ (Number(va17))+ (Number(va18))+ (Number(va19))+ (Number(va20));
ctrlTotal.setValue(gtotal) ; // adds total points from Var Va1-20
if (ctrlTotal.getValue() >79) { pf.setValue("Pass" );
}
else
{
pf.setValue("Fail");
That part works great but I would like to have "Pass" turn the font Green and abd "Fail" turn it Red. I've tried various things but nothing seems to work. Any ideas or insperation would be great. I have already looked at the conditional formatting but it is in PHP and I need this to to be in Jscript since it changes on the fly with the value change.
Thanks in advanced