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

Any one know how to Change the color on a Checkbox Caption?

RobertH
Registered: Feb 12 2009
Posts: 3
Answered

I use the following code to change the caption on a checkbox to bold if it is checked.

if (this.rawValue == true)
{this.caption.font.weight = "bold";}
else
{this.caption.font.weight = "normal";}

Does anyone know what codes get me to the color setting. Also, is the caption in rich text, could this be why I can not seem to change the color attribute?
Thanks
RobertH

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
How about,

this.fontColor = "256, 0,0";

Do you have the XML form object model reference? It's all in there.

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]

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

RobertH
Registered: Feb 12 2009
Posts: 3
It didn't work. Also, I am actually trying to get to this caption's attributes from a separate checkbox javascript action. Where can I get the XML form object model reference?
Thanks
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can find the "XML form object model reference" and several other very useful documents at:

http://partners.adobe.com/public/developer/xml/topic.php

About the color, my fault. The color chanels vary between 0 and 255.

However, this.fontColor = "255, 0,0", changes the color of the check.
This code changes the caption to green

this.caption.font.fill.color.value = "0,255,0"

You can also change the background color

this.caption.fillcolor = "0,255,0"

Some of the field properties are predefined, like fontColor and fillColor, but others you have to dig into the XML to find, like the caption color. To find a property like the caption color, set it to some odd value in the Designer UI, then open up the XML to see the exact path to the property.

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]

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