Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JSP Search box

Status
Not open for further replies.
Jan 30, 2007
6
US
Okay, I've been handed a project for a guy who has gone on three weeks of vacation, and I'm clearly not the coder he is.

So my problem is this: He created this very advanced (for a prototype) search box where you automatically get a list of results based on the first letter you type. Here is an image to help describe it:

searchbox.PNG


You insert the letter "m" in the top field, and automatically the bottom field appears with results for you to select from. As far as I can tell the "search" button is worthless.

What I need is to ditch the auto-results part of it. When I type "m" results can't instantly appear in the bottom field. I need to type "m" and then press the "Search" button for the lower field to fill.

So here is a snippet of his code:

Code:
<input type="text" id="search" name="search" value="" onkeyup="showHint(this.value);tempRetrieve();" onkeypress="showHint(this.value);tempRetrieve();" size="40" class="formFont">&nbsp;<a href="javascript:onclick=searchField();"><img src="<%= searchImg %>" border="0"></a>

How would I change that code to find the results only after clicking the search button?
 
I'd review the functionality you want to achieve.

When you press a key, what you get is a hint about the search. The actual search doesn't start until you press the button.

If you want to deactivate the hints, remove

Code:
onkeyup="showHint(this.value);tempRetrieve();" onkeypress="showHint(this.value);tempRetrieve();"

Btw, that's Javascript.

Cheers,
Dian
 
Thanks again Dian. Again my problem seems to have been the understanding of what the current code actually does. That's all I needed to know though, so much appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top