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=$ci ty&mcat=re st>Restaur ant</a><p>
<a href="result.php3?city=$ci ty&mcat=cl oth>Cloth< /a><p>
</form>
</body></html>
-----------------
#result.php3
<html><head><title>
Trying It! </title></head>
<body>
<?
echo "$city";
print "<p>";
echo "$mcat";
?>
</body></html>
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=$ci
<a href="result.php3?city=$ci
</form>
</body></html>
-----------------
#result.php3
<html><head><title>
Trying It! </title></head>
<body>
<?
echo "$city";
print "<p>";
echo "$mcat";
?>
</body></html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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 :)
this referred to the initial posting :)
ASKER
thanks to both, but according to my need javascript has worked fine.
try the following:
<select> as above,
then
<input type=submit name=mcat value=Restaurant>
<input type=submit name=mcat value=Cloth>