Click to See Complete Forum and Search --> : php javascript help needed


furqan_sindhu
12-18-2005, 04:50 AM
hello all !

i have a drop down menu in my site and what i wanna do is when user selects an option from the drop down menu, search the database and fill the relevent details of the selected option in the text boxes present in the same form.




now, i can use javascript to call a function for onchange property of select tag

e.g. <select name="etc" onChange="displayvalues()">

BUT problem is how can i get values from database in that function ????


pls help me in this regard!

ShrineDesigns
12-18-2005, 06:18 AM
you could use the JavaScript XMLHttpRequest (http://www.google.com/search?q=xmlhttprequest)

winged1
12-18-2005, 10:28 AM
or a POST to script which queries your database and serves a new page.

bokeh
12-18-2005, 11:38 AM
or a POST to script which queries your database and serves a new page.I agree. This should always be the default option. Before considering XmlHttpRequest I would decide if it is practical to just use a javascript array loaded at the time the page first loaded. 9 times out of 10 this is fine.