开发者

Retrieve values at the time of edit in jsp?

开发者 https://www.devze.com 2023-02-03 01:36 出处:网络
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 textboxas like a google search(using Ajax).

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消