Multiple dropdown boxes with one Submit Button

I am trying to figure out how to create 3 drop down boxes that contain one Submit button.

So that when I hit submit it will send 3 variables to the next page (so that I can do a query based on all 3 variables)

I can not figure out how to do it… can anyone point me in the right direction?

Thanks

BTW: I do have one drop down box working perfect, just a matter of getting the other 2 in there with the same submit button

As long as you have all of the <select> boxes within the same <form> they will all get submitted when you submit said form.


<html>
  <body>
	<form blah blah blah...>
 
	  <select name="firstBox">
		<option value="value" />Text
		<option value="value" />Text
	  </select>
 
	  <select name="secondBox">
		<option value="value" />Text
		<option value="value" />Text
	  </select>
 
	  <select name="thirdBox">
		<option value="value" />Text
		<option value="value" />Text
	  </select>
 
	</form>
  </body>
</html>

Of course your variables for this particular form are, $firstBox, $secondBox, $thirdBox.

Someone correct me if i’m mistaken, but shouldn’t a select box be set up as:



<select name="firstBox">
	 <option value="value">Text</option>
	 <option value="value">Text</option>
</select>




PHP John closed the option element before its content (“Text” ).

Just being picky. images/smilies/tongue.gif

You can actually do it either way… and honestly, I don’t remember which way is the “valid” way of doing it. :slight_smile:

Thanks everyone, I appreciate the input and it helps me out alot!

Hey, my mistake!

The proper, “valid” way to code the <option>'s is exactly as FatNewt said.

Thanks!