views:

18

answers:

2

Javascript noob here (I'm assuming I will need Javascript to solve this).

I need to make a page which directs a user depending on the selection they make from two dropdown lists.

Lets say I have a form with two lists:

A contains

<option>1</option>
<option>2</option>
<option>3</option>

B contains

<option>1</option>
<option>2</option>
<option>3</option>

and for A I select 3 and for B I select 1.

When I press submit, I want to link to www.example.com/example.php?a=3&b=1

How do I go about changing the link based on the two user selections?

A: 

If you do a HTTP GET, you should get that automatically from your form.

Daniel A. White
from both forms?
tom
you only described 1 form in your problem.
Daniel A. White
sorry nevermind, i meant both lists but I've got it working. thanks
tom
+1  A: 

Just put those menus inside one form that has the method set to GET:

<form action="example.php" method="get">
<!-- here your menus-->

<!-- this will create a button to send the data-->
<input type="submit" value="Go" />
</from>

Of course, you will have to properly name your <select> elements:

<select name="a">
  <option>1</option>
  <option>2</option>
  <option>3</option>
</select>
Cristian
thanks dude, worked like a charm
tom