Hi guys!
I'm new to JS programming within pdf's, and also in this forum.
I've made a form, which is just a multi-line text, with a text-link acting as submit button.
I've made it from linux, using tex, pdfmarks and ghostscript. And the cgi on my server is a small c program I laid out for this.
Anyways, this all works, I can receive data sent from the pdf as HTML POST, and process it back in the server with no hassle.
The problem I'm facing has more to do with events in acrobat read, as I'd like the form to behave properly.
By using /K, /E, /Fo, etc.. actions within the text-field's annotacion (through the /AA dictionary), I can't reach my goal, which is as follows:
Having the text-field, I'd like it to show some text by default (i.e: "use this box to leave us a comment or message"). Once the user gives the field input focus (either by clicking on it of through the TAB key), the text dissapears, so it's not disturbing the user.
If he/she doesn't write anything and the field looses the input focus (note: just the input focus, no the just itself), and again, either by clicking outside the field or through the ESC key, my default text will get there again.
So my question is: First, is this achievable at all? if so, perhaps should I leave empty the /AA dictionary for that field, and place a script on that page's dictionary?
Advises on this would be much appreciated.
Regards,
OnFocus:
event.target.value = "";
OnBlur:
if(event.target.value == "")
event.target.value = event.target.defaultValue;
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]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script