Link to home
Start Free TrialLog in
Avatar of tripat
tripat

asked on

passing the different form variables

dear experts,

I have to design a form having drop down list of cities and various links to different categories.

Now I want if someone selects one city and clicks on the link of category another script should be invojed pasing the values of city and link on whichit was clicked.

I am briefly giving the two codes below.

-----------
<html><head><title>
Trying It! </title></head>
<body>
<form>
<select name=city>
<option selected>Ludhiana
<option>Delhi
<option>Calcutta
</select><p>
<a href="result.php3?city=$city&mcat=rest>Restaurant</a><p>
<a href="result.php3?city=$city&mcat=cloth>Cloth</a><p>
</form>
</body></html>


-----------------
#result.php3

<html><head><title>
Trying It! </title></head>
<body>
<?
echo "$city";
print "<p>";
echo "$mcat";
?>
</body></html>
ASKER CERTIFIED SOLUTION
Avatar of us111
us111
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mafweb
mafweb

this will not work :-)

try the following:

<select> as above,

then

<input type=submit name=mcat value=Restaurant>
<input type=submit name=mcat value=Cloth>
hmm the first version works :))
I've tried it :)) I never post a comment without testing :)))

except my second version, I've forgotten
<input type=submit name="Send" value="Send">  in the form
sorry us111,

this referred to the initial posting :)
Avatar of tripat

ASKER

thanks to both, but according to my need javascript has worked fine.