after testing i found out that the problem is as you said andrea is not in the xmlHttp request.
the above response is suppose to go toCode:<?php $q=$_GET["q"]; $con = mysql_connect('s', 'u', 'p'); if (!$con) { die($ERROR_CONNECTING_MYSQL . mysql_error()); } mysql_select_db("world", $con); $sql="SELECT DISTINCT City FROM geoinfo WHERE country = '".$q."'"; $result = mysql_query($sql); echo "<option>Select a City</option>"; while($row = mysql_fetch_array($result)) { echo "<option value =\"" . $row['City'] . "\">" . $row['City'] . "</option>"; } echo "<option value = Other...>(City not listed - Click here)</option>"; mysql_close($con); ?>
where P_City is an id of a <select> tag. it works in all browsers but not in IE.Code:document.getElementById('P_City').innerHTML=xmlHttp.responseText
The only way to make it work in IE is by changing the PHP code to
and creating a new <div> tag to load the above response text inCode:<?php $q=$_GET["q"]; $con = mysql_connect('s', 'u', 'p'); if (!$con) { die($ERROR_CONNECTING_MYSQL . mysql_error()); } mysql_select_db("world", $con); $sql="SELECT DISTINCT City FROM geoinfo WHERE country = '".$q."'"; $result = mysql_query($sql); echo "<select>";//CHANGE echo "<option>Select a City</option>"; while($row = mysql_fetch_array($result)) { echo "<option value =\"" . $row['City'] . "\">" . $row['City'] . "</option>"; } echo "<option value = Other...>(City not listed - Click here)</option>"; echo "</select>";//CHANGE mysql_close($con); ?>
which means that i must first remove the <select> tag from the html page and load the whole tag dynamically. but can not load the <options> only .Code:document.getElementById('NEWP_City').innerHTML=xmlHttp.responseText
Is this an error in IE or do i need to update my IE..??
hope this is clear enough.
kimoo




Reply With Quote