I have two selection list, which the second one populates depending at the selection of the first.
- <select id="category" onchange="getRegions('1',this.value,'region','imagediv1')" >
-
<option selected="selected" value="" > Please Select Category</option>
-
<?php
-
do {
-
print ("<option value=\"".$row_Recordset1['id_categories_pk']."\"");
-
-
print(">".$row_Recordset1['category_name']."</option>");
-
-
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
-
$rows = mysql_num_rows($Recordset1);
-
if($rows > 0) {
-
mysql_data_seek($Recordset1, 0);
-
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
-
}
-
?>
-
</select>
Second one
- <select id="region" onChange="getImage('category',this.value,'imagediv1')" >
-
<option selected value="">Select Category First</option>
-
</select></div></td>
- function getRegions(languageId,categoryId,element) {
-
-
enable_list(element);
-
var strURL="regions.php?language="+languageId+"&category="+categoryId;
-
-
var req = getXMLHTTP();
-
-
if (req) {
-
-
req.onreadystatechange = function() {
-
if (req.readyState == 4) {
-
// only if "OK"
-
if (req.status == 200) {
-
document.getElementById(element).innerHTML=req.responseText;
-
} else {
-
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
-
}
-
}
-
}
-
req.open("GET", strURL, true);
-
req.send(null);
-
}
-
-
}
The problem ( only in IE), the second list is complete blank.I think the problem is at getRegions('1',this.value,'region') with this.value or with getElementById.
What i have to change to above code so the IE will be ok?