View Single Post
Old 08-13-2008, 02:07 PM   PM User | #1
masterofollies
Senior Coder

 
Join Date: May 2005
Posts: 2,137
Thanks: 96
Thanked 72 Times in 72 Posts
masterofollies can only hope to improve
Showing results from select box

My website is in PHP but I think that this would be a Javascript thing. Correct me if I am wrong.

I have a select box like this,

Code:
echo "<select name='ptype' style='background-color:#CDBA96;'>";
   echo "<option value=\"1\">Product 1</option>";
   echo "<option value=\"2\">Product 2</option>";
   echo "<option value=\"3\">Product 3</option>";</select>
I want it where under the box is blank (already is) but when they drop down the menu and select something, it runs a query and produces the results. I didn't want to use a submit button, just change when they select the field in the box. Would Javascript be used for this?

I figured <form action="blah.php?do=products" method="post"> would work, but then it'd be going to a whole new page. What can I do? Thanks.

Last edited by masterofollies; 08-13-2008 at 02:07 PM.. Reason: .
masterofollies is offline   Reply With Quote