These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Need Help changing fontcolor in a Numeric Field when a number < 70.

peacedawg
Registered: Feb 27 2008
Posts: 2

Hi all,

I am not so good with Javascript or FormCalc. I am mostly a VB6 programmer. I have attempted a number of different expressions and statements to get my Numeric Field value to change color when it meets a condition. For example;

If TotalScore.value < 70 then
Totalscore.value.fontcolor = Red

Else
TotalScore.value.fontcolor = Blue

End If

I know this isn't proper script, but displays what i am trying to achieve. I have spent countless hours researching this probably simple task. However, I have
not been able to find a javascript example to make this happen. By the way in the editor Event drop down menu, which do I select Change, Keydown, Initialize, Validate? I would greatly appreciate the help. It's the last item left to complete my custom form.

Thanks in advance,

Robert

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You're color format is off. The colors are expressed as 1 byte RGB in a string list

For Red:
Totalscore.value.fontcolor = "256,0,0"

Take a look at this article. It includes code for changing colors in a LiveCycle document, and a little explaination.

http://www.acrobatusers.com/tutorials/2007/js_disabling_fields/

If your changing colors based on a field value, then this code should be included in the calculation script for the field that's being colored.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script