Hi!
I'm currently working on a internal handbook for computer related problems. In this document I want a home button (to the home page), a help button (to the help page) and a search box.
Nearly everything works perfectly (thanks to this site!!!) but I still have two issues.
The program I use is Acrobat Professional 8.1.
The search box is a text box, and next to it is a "Go" button which runs the javascript:
var Searchword = this.getField("Search").value;
search.bookmarks = "true";
search.wordMatching = "MatchAllWords";
search.query(Searchword, "ActiveDoc");
It runs a query and works great! Except one thing, it always finds the value in the search box first which I just typed in, and since the searchbox is duplicated to every page, it finds it multiple times.
As you may understand, this is pretty annoying and I would like to exclude this box in the search or something. One workaround which works is to reset the Searchbox value to "Search..." before the query is executed but this is not perfect.
The other issue is simpeler (I think :p), I would like to run a javascript when someone types something in the searchbox and presses Enter instead of clicking on "Go".
Any ideas?
Thanks in advance!
Use the "Advanced > Document Processing > Manage Embedded Index..." menu itemTo run the code when the user hits the return key, place your search script into the Format Script.
This script will run only when the user presses return after entering new data. It will not search if the user tabs or clicks out of the field and it will not search for white space (empty entries).
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.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script