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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning data with ajax 1

Status
Not open for further replies.

dle46163

IS-IT--Management
Jul 9, 2004
81
US
Hi All,

I have an html form which I'm using to send data via ajax to a PHP script. The PHP script sends data back and it's displayed on the screen between DIV tags. This works fine. However, instead of displaying the data between DIV tags, I want the data to be returned inside the forms input field. Below is my form script.. Anyone want to take a crack at this?!

<div class='box' id='autocomplete' style='WIDTH:100px;'></div> <-- This is where the returned data shows up

<form name='search'>
<input name='keyword' onKeyUp='SendQuery(this.value)' class='formfield' maxlength='20' style='WIDTH:100px' autocomplete='off'> <-- Here I'd like to insert VALUE=XXX which would be the returned data.. Can this be done??
</form>

Any thoughts would be much appreciated!
 
Code:
document.forms["search"].elements["keyword"].value = [purple][i](return value from ajax)[/i][/purple]

-kaht

Looking for a puppy? [small](Silky Terriers are hypoallergenic dogs that make great indoor pets due to their lack of shedding and small size)[/small]
uncle_rico_thumb.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top