HI, I am using Roshan's Ajax dropdown code for my two ajax dropdown menus.
All is working fine, but when I want to use $_POST in the submitted form with FireFox, its not working...??? Its working fine in IE.
Can anybody please help me with this problem?
The Form where the dropdown is:
<!-- Province goes here -->
<tr>
<td>-</td><td>-</td><td>-</td><td>-</td><td>Province</td><td>
<select name="province" onChange="getCity('../dir/townsrc.php?province='+this.value)">
<option value="">Select Province</option>
<option value="1">KwaZulu-Natal</option>
<option value="2">Western Cape</option>
<option value="3">Eastern Cape</option>
<option value="4">Free State</option>
<option value="5">Gauteng</option>
<option value="6">Limpopo</option>
<option value="7">Mpumalanga</option>
<option value="8">North West</option>
<option value="9">Northern Cape</option>
</select>
</td>
</tr>
<!-- Province ends here -->
<!-- Town goes here -->
<tr>
<td>-</td><td>-</td><td>-</td><td>-</td><td>Town</td><td>
<div id="citydiv"><select name="city">
<option>Select Town</option>
</select>
</div>
</td>
</tr>
<!-- Town ends here -->
The townsrc.php:
<? $country=intval($_GET['province']);
$query=("SELECT * FROM search_town
WHERE provId=$country
ORDER BY townLabel ASC");
$result=mysql_query($query);
?>
<select name="city">
<option>Select Town</option>
<? while($row=mysql_fetch_array($result)) { ?>
<option value><?=$row['townLabel']?></option>
<? } ?>
</select>
The submit for:
$province = trim($_POST['province']);
$city = trim($_POST['city']);
In IE $province and $city gets posted
In FF only $province gets posted
Can it maybe something got to do with the <div>????