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

Need Some Direction on Changing Text Feild FontColor via Drop Down

Bob Casey
Registered: Aug 5 2009
Posts: 22
Answered

Hello I am fairly new Desinger 8.2 and need to change the font color of a text field base upon a drop down selection.

My Script editor language is set to Java Script and on click I have the following JavaScript:

if (xfa.event.newText == "White")
{
TextField3.fontColor = "255.255.255";
}
if (xfa.event.newText == "Black")
{
TextField3.fontColor = "0.0.0";
}

I thought I had right, but no go. I would like to know why. Your help is much appreciated

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The color chanels are separated by a comma, not a dot. For example:

TextField3.fontColor = "255,255,255";

This code would work better in the Change event.

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/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

Bob Casey
Registered: Aug 5 2009
Posts: 22
Thank you. It work perfectly