Google never fails to come up with ideas which though seem small, are pretty useful. You would feel the need and presto they come up with it! The recent addition is Google Suggest. Google Suggest provides you with suggestions as you type your keywords. These keyword-suggestions are ranked by the number of results. Another website which does this is SurfWax News Accumulator.
The user experience is good without any intermittent page refreshes, the way the do this is quite simple:
1. Handle the OnKeyUp event for the text box where the keyword is typed, so that after every keystroke the function can assess what the user has typed and whether it can make any suggestions.
<input onkeyup="ShowSuggestions(event);" name="txtSearch">
2. Provide an IFRAME below the txtSearch textbox (say iSuggest) which will display the suggestions. Every IFRAME has an URL property from which it loads its contents and this URL can be changed dynamically.
//get char code
charCode = e.which;
//check if it is enter key, then submit the form to search
if (charCode == 13)
if is not enter key, get the letters so far typed change the URL of the IFRAME so that it now refers to your search URL. Pass the letters so far typed as a partof the querry-string. Your search URL provides the suggestions as the response which will be displayed below the search textbox
iSuggest.location = "http://mysearch.com/suggest.aspx?wordsSoFarTyped=" + txtSearch.value;
Hmm, quite interesting and simple right?