PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/ __________________________________________________________________
As you noticed correctly, the clearItems() method does not work with text fields.
However, what would work with text fields is, if you put the following code in the onFocus event of the field:
event.target.value = "" ;
And that should do it.
However, you would probably be lynched by your users, because that code would delete any entered value when they incidentially click into the field again...
So, a much better approach would be defining a function, and call it from the onFocus event:
function clearMe()
{
if (event.target.value == event.target.defaultValue) {
event.target.value = "" ;
}and you would call it with
clearMe() ;
And one more step to make it worthwile would be adding another function which restores the default if nothing has been entered. That would mean, for example
function restorme()
{
if (event.target.value == "") {
event.target.value = event.target.defaultValue ;
}
}which you would call in the onBlur event with:
restorme() ;
and you have a little enhanced form.
Hope, this can help.
Max Wyss PRODOK Engineering Low Paper workflows, Smart documents, PDF forms CH-8906 Bonstetten, Switzerland
Fax: +41 1 700 20 37 or +1 815 425 6566 e-mail: mailto:[EMAIL PROTECTED] http://www.prodok.com
[ Building Bridges for Information ]
______________________
Shameless Plug:
Things like that, you would learn at my next conference appearances and workshops:
• Training classes in cooperation with essociates Group, in Toronto, ON, Canada, March 9 - 12, 2004; more information at http://www.essociatesgroup.com/AdvancedAcrobatForms.htm and http://www.essociatesgroup.com/MultipleLanguageFormsInAcrobat.htm
• And, as always, available for on-site workshops/tutorials/consulting.
_________________________
I have a form in which a few of the fields have example text (entered via Field Properties > Options > Default). The example text is something like "Name and Extension". It is there to prompt the user to include the needed information when filling out the form.
I'd like the example text to disappear when the user puts their cursor in the text box. I saw "clearitems" in the Acrobat JavaScript Object Specification, but that does not apply to text boxes.
Any ideas on how to accomplish this would be appreciated. Thanks in advance fo ryour help.
To change your subscription: http://www.pdfzone.com/discussions/lists-pdfforms.html
