I have two auto-populating drop down boxes on the same page. The first one (select a state) works fine in IE and FF. Once a state is selected the second one appears and is supposed to contain a list of cities that correspond to that state. This function works in FF. In IE it just says "Select a city city1 city2" and so on, no drop down.
Here is the code:
<form id="form1" name="form1" method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
<?php
if (isset ($_POST['state'])) // if the form was submitted, display their name
{
?>
<select name="state" CLASS="formTextbox" onchange="this.form.submit();">
<option value="<?=$state;?>"><?=$state;?></option>
<?php
}
else{
$Get_State = mysql_query("SELECT DISTINCT state FROM coupons",$db_link);
?>
<select name="state" CLASS="formTextbox" onchange="this.form.submit();">
<OPTION SELECTED VALUE="">Select A State</OPTION>
<? while($get_it = mysql_fetch_array($Get_State)) { ?>
<option value="<?=$get_it['state'];?>"><?=$get_it['state'];?></option>
<?
}
?>
</select>
<?php
}
if (isset ($_POST['state'])) // if the form was submitted, display their name
{?>
</form>
<form id="form2" name="form2" method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
<?php
if (isset ($_POST['city'])) // if the form was submitted, display their name
{
?>
<select name="city" CLASS="formTextbox" onchange="this.form.submit();">
<option value="<?=$city;?>"><?=$city;?></option>
<?php
}
else{
$Got_City = mysql_query("SELECT DISTINCT city FROM coupons WHERE state='$state'",$db_link);
?>
<select name="city" CLASS="formTextbox" onchange="this.form.submit();">
<OPTION SELECTED VALUE="">Select A City</OPTION>
<? while($got_it = mysql_fetch_array($Got_City)) { ?>
<option value="<?=$got_it['city'];?>"><?=$got_it['city'];?></option>
<?
}}
?>
</select>
<?php
}
?>
</form><br />
<?php
if ($city && $state)
{
$Get_Coupons = mysql_query("SELECT coupon_image, coupon_number FROM coupons WHERE state='$state' AND city='$city'",$db_link);
while($get_deals = mysql_fetch_array($Get_Coupons)){
$image = $get_deals['coupon_image'];
$number = $get_deals['coupon_number'];
?>
<img src='coupons/<?=$image?>'>
Any ideas?