PDA

View Full Version : query without submit?


Darksbane
10-14-2002, 11:07 PM
Is there a way to get query results from a database without submitting the form? Here is my situation. I have a select box with many entries, those entries all have different values assoicated with them. When a user clicks on an item in the select box I would like to show them the other information assoicated with that selection on the same page (using DIV's and Layers to dynamically display the data). I really don't want to send all the values every time the page loads (as a user might only look at 1 or 2) because it would make the page too large. So is there a way that when a user clicks on an item in the select box I can query my database and grab that items statistics to display without submitting the form.

Any help would be appreciated,

Darksbane

Alekz
10-15-2002, 08:51 AM
Hi,
Here's a related thread:
http://www.codingforums.com/showthread.php?s=&threadid=7523

Alex

JohnDubya
02-20-2007, 01:29 AM
For anyone finding this thread five years after it was posted, like I am now...here's a very simple way to make select boxes fill with information from a query. You can use PHP from within this Javascript, which is what I did. If you need help using this script with PHP, give a shout.

http://www.codingforums.com/showthread.php?t=107194

Fou-Lu
02-20-2007, 05:57 AM
Ajax is the easiest way.
Be careful on your methods of using it however, I found out the hard way (yes I wasn't thinking ahead :P) that if you use an onchange event with a text area it resends a query on every typed letter. Not good on the sql server.