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

Changing Font Colors in Text Field

Mr_Grump
Registered: Jul 17 2008
Posts: 27
Answered

Hello Everyone

I'm trying to change the font color in a field after the user has entered text. I'm currently using a RadioButtonList and the following script:

txtfldCOMMENTS.fontColor = "0,183,0";

I've searched through the forum and found a PDF form that will give the RGB values for the color palette but can't figure out how to implement it in JavaScript. An example color would be:

["RGB", 0,0.667,0]

The PDF ColorCalculator form can be found at http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/using_colors/ColorCalculator.pdf

Any help would be greatly appreciated.

Thanks

Lane

My Product Information:
Acrobat Pro 9.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The code you provided:

txtfldCOMMENTS.fontColor = "0,183,0";

is for an element on a [b]LiveCycle form[/b]. The ColorCalculator PDF is a demonstration of using color in an [b]AcroForm[/b]. These are two very different things. Which are you using?

You can convert values provided on the "Color" Calculator to LiveCycle colors by multiplying the "RGB" values by 255.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

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

Mr_Grump
Registered: Jul 17 2008
Posts: 27
Thomp

Thanks. I'm using LifeCycle. I just assumed that RGB would be the same. THanks for your help. I'll try your suggestion.

Regards

Lane