Retrieve values at the time of edit in jsp?
I am new t开发者_如何学JAVAo jsp. I have the list of names in the database. I need to get the list of names at the time of enter the values in the textbox as like a google search(using Ajax). I need the simple sample for this.Can anyone help me !!!!!
Here's a tutorial you might find useful.
Do as Follows:
In Javascript using Ajax:
xmlhttp=new XMLHttpRequest();
url=url+"?val="+str1;
xmlhttp.open("POST",url,false);
xmlhttp.send(null);
document.getElementById('my2').innerHTML=xmlhttp.responseText;
Where url
will be the URL to which you will post data. Str1
is the typed value in textbox. and my2
is the box which you will show as auto suggest.
At serverside coding in Servlet get the names from db and send it in response to display.
精彩评论