[SOLVED] desperatly need help
Posted: Thu Aug 12, 2004 4:37 pm
hello. I'm trying for many days now to make a dropdown that has an onchange event.
I have the following drpdown :
OK. When I select a country, the form is submited, the page reloaded and and the selected option is the first in the list.
I want that after the form is submited and the page reloaded, the selected country to be the one I choosed before.
Pls help
Thx a lot
I have the following drpdown :
Code: Select all
<?php
<form name="country" action="<? $PHP_SELF; ?>" method="post">
<select name="chooseCountry" onChange="submitpage()">
<option value='0'>Choose country</option>
<?
$querydrop = "select * from countryes";
$result = mysql_query($querydrop);
while($row = mysql_fetch_array($result))
{
if($row['id']==$chooseCountry)
{
print "<option value="".$row['id']." selected">".$row['country_name']."</option>";
}
else
{
print "<option value="".$row['id']."">".$row['country_name']."</option>";
}
}
?>
</select>
</form>
?>I want that after the form is submited and the page reloaded, the selected country to be the one I choosed before.
Pls help
Thx a lot