Deleting Text and changing font color in a Text Box when on Focus

41 views
Skip to first unread message

realitik

unread,
May 21, 2008, 2:21:38 PM5/21/08
to CenoPDF Support Group
Hi... I'm new to JavaScript and new to CenoPDF. I'm very impressed
with Ceno and have found it easy to use. I have very limited
programming knowledge and have read thru the documentation on Adobe's
site in regards to JavaScript and the info on Ceno and have been
unable to determine if what I'm wanting to do is possible. Hopefully
you can help. I'm using the most recent Ceno version and Microsoft
Word 2003, Service Pack 3.

I have a Text Box called "Guarantee". The default text in the box is
"Minimum 50" and is in a light gray font. I have set these defaults
using the Appearance and Options tabs of the text box properties
dialog box.

What I would like to do is when that text box is in focus, i would
like to have it clear the contents of the field and change the color
of the text that will be typed in its place to black. I can't find
anything that tells me if this is possible and/or what the syntax
would be in JavaScript. Any help would be appreciated! Thanks!

-Mike

CenoPDF Support

unread,
May 21, 2008, 6:26:50 PM5/21/08
to CenoPDF Support Group
Hello Mike,

I have created a form to simulate your request. You can go to "On
Focus" trigger and add a Javascript action with the following script:

event.target.value = "";
event.target.textColor = color.black;


You can search for those keywords in JavaScript for Acrobat API
Reference to find their explaination and other functions to control
the fields.

-- CenoPDF Support

realitik

unread,
May 27, 2008, 5:36:46 PM5/27/08
to CenoPDF Support Group
Thanks!

This worked perfectly!

Appreciate your prompt response!

-Mike
Reply all
Reply to author
Forward
0 new messages