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

Removing search field hits

DTjava
Registered: Jun 17 2011
Posts: 21

Hi again,
 
I'm encountering a search coding issue -
  
Using this post as inspiration, I'm adapting the code to my own needs:
http://acrobatusers.com/forum/forms-acrobat/homemade-search-field-questions
 
The code:
 
var Searchword = this.getField("Search").value;
search.bookmarks = "true";
search.wordMatching = "MatchAllWords";
search.query(Searchword, "ActiveDoc");
 
In that previous post, the issue was that when you run a search from a custom search field, it finds the "searchword" along with all the other returns. Therefor you have to manually skip the first instance of the searchword every time. Annoying.
 
The solution posted was embed an index (making sure all your fields are empty). When you run the search next time, it will look at the index and not the doc, bypassing your searchword altogether.
 
Doesn't seem like that's the case. I've done my index embedding, but I'm still getting a return on the "searchword." I also tried changing "activedoc" to "activeindexes" but that's a step backwards: It only exports your searchword to the search window and doesn't automatically run the search.
 
End goal here is to type in a word in our field, have it automatically search using acrobat's search tool (after pushing our custom search button to run the script), but bypassing all instances of the searchword field so it doesn't show.
 
Any idea on what I'm doing wrong?
  
D.

My Product Information:
Acrobat Pro 9.0, Windows
DTjava
Registered: Jun 17 2011
Posts: 21
Oh, and I've done a rough work around: I added a mouseup event to clear the text field just after the javascript search runs. Meaning it grabs the text data and clears the field before finding it in the search pane. That works ok, but I'd still like to know if there is a way to get the aforementioned index fix to work.

Thanks!


D.