Jeg har en dropdown hvor man først vælger et land og derefter kommer der byer frem som passer til landet. Landet i den første dropdown virker fint på i Firefox og IE, men i IE kommer der ingen byer frem.
Jeg har prøvet at ændre onclick til onchange men virker stadig ikke... nogen idé?
Koden:
<form name="dealersform" action="dealers.php">
<div id="country">
<?php error_reporting (E_ALL ^ E_NOTICE);
//get all models from database
$result = returnStoreCountries();
$num_rows = mysql_num_rows($result);
$i = 0;
echo getTextValue("DEALERS_COUNTRY",$_COOKIE["cdl_language_cookie"]) . "<br />";
echo "<select name=\"s_country\" id=\"s_country\" style=\"width:175px; margin-top:5px;\">";
echo "<option onclick=\"document.dealersform.submit();\">";
echo getTextValue("DEALERS_COUNTRY_BOX",$_COOKIE["cdl_language_cookie"]);
echo "</option>";
while ($i < $num_rows) {
if($_GET[s_country]==mysql_result($result, $i, 'ID')) {
echo "<option selected=\"selected\" onclick=\"document.dealersform.submit();\" value=\"" . mysql_result($result, $i, 'ID') . "\">" . mysql_result($result, $i, 'NAME') . "</option>" ;
} else {
echo "<option onclick=\"document.dealersform.submit();\" value=\"" . mysql_result($result, $i, 'ID') . "\">" . mysql_result($result, $i, 'NAME') . "</option>" ;
}
$i++;
}
echo "</select>";
?>
</div>
<div id="city">
<?php
getTextValue("DEALERS_CITY",$_COOKIE["cdl_language_cookie"]) . "<br />";
echo "<select name=\"s_city\" id=\"s_city\" style=\"width:175px; margin-top:5px;\">";
//get all models from database
$result = returnStoreCities($_GET[s_country]);
$num_rows = mysql_num_rows($result);
$i = 0;
if ($num_rows != 0){
echo "<option onclick=\"document.dealersform.submit();\">";
echo getTextValue("DEALERS_CITY_BOX",$_COOKIE["cdl_language_cookie"]);
echo "</option>";
while ($i < $num_rows) {
if($_GET[s_city]==mysql_result($result, $i, 'NAME')) {
echo "<option selected=\"selected\" onclick=\"document.dealersform.submit();\" value=\"" . mysql_result($result, $i, 'NAME') . "\">" . mysql_result($result, $i, 'NAME') . "</option>" ;
} else {
echo "<option onclick=\"document.dealersform.submit();\" value=\"" . mysql_result($result, $i, 'NAME') . "\">" . mysql_result($result, $i, 'NAME') . "</option>" ;
}
$i++;
}
}
else {
echo "<option onclick=\"document.dealersform.submit();\">";
echo getTextValue("DEALERS_CITY_BOX",$_COOKIE["cdl_language_cookie"]);
echo "</option>";
}
echo "</select>";
?>
</div>
</form>