You could make the server return the HTML as the response.
If your suggest box is a <select> object, you can create a
jsp file to answer with a new <select> object, and replace it.
The file which has the suggest:
<input type="text" id="suggestFilter" on key Press="search();"/>
<div id="divSuggest">
<select></select>
</div>
function search()
{
//creates the url that has the filterQuery
}
function responseHandleMethod(){
resultDivTag=document.getElementById("divSuggest");
if (req.readyState==4){
if (req.status==200){
var response=req.responseText;
if (response=='0'){
resultDivTag.innerHTML="";
}
else{
resultDivTag.innerHTML=response;
}
}
}
}
And the JSP which has the response:
<select>
<option value="1">result....</option>
<option value="2">result....</option>
<option value="3">result....</option>
<option value="4">result....</option>
</select>
I hope this helps you to build the Suggest field.