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

Using Javascript to change fill color in text box

wislndixie
Registered: Oct 3 2006
Posts: 125

I'm using adobe Pro 9.0 and have a form created in acrobat not live cycle that I want the text boxes to change color when they are tabbed to. I've used this script before with success in earlier versions of acrobat but it doesn't seem to work in 9.0. Could someone look at this script and see if I'm missing something?

In the actions tab I set the following for my text box

On Focus
var txtField = event.target
txtField.fillcolor = color.yellow
txtField.txtcolor = color.white

Than I add another script
On Blur
var txtField = event.target
txtField.fillColor = color.transparent
txtField.textColor = color.black

When I put this in my text box, the color doesn't change to yellow. It stays white.

Thanks for any help.
Mike

My Product Information:
Acrobat Pro 9.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Use "fillColor" and "textColor", as you do in your On Blur script.

George