Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting a default field highlight in acrobat 9 pro

Status
Not open for further replies.

mrjack60

Technical User
Aug 13, 2013
2
US
I have been using Acrobat Pro for several years now, but I am new to javascript. I have been beating my brains out trying to figure this one out. I am creating a form to be filled out. some questions are mandatory, some are optional. I am color coding these as needed with the fill highlight. As the user enters data in a field, the fill highlight goes away.

I want to set a document level javascript that I can select the fill highlight as a default color, say light blue. I cannot seem to get it right.

I can do this with a field level javascript. You set the appearance color you want for the field, then to to the actions tab and set an onblur changing the color to transparent. However, when you reset the form, the highlight does not return. Is this the only way I can get this done?
 
I think I figured out the answer for myself. I do not think you can do this with a document level script.

It can be done on a field level script in the "Format" tab, custom format

the following script works well, (but highlight color is light green)

var f = event.target;
if (f.value != "")
{f.fillColor = color.transparent;
f.textColor = color.black
event.target.display = display.visible;}
else
{f.fillColor = ["RGB", .56, .99, .64];
f.textColor = color.black;
event.target.display = display.noPrint;}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top