santin Posted December 7, 2008 Share Posted December 7, 2008 first of all I want to say that the script works fine in FF and Chrome, but not on IE. the script is 90% from w3school - http://www.w3schools.com/php/php_ajax_database.asp in my server : http://ballon.inetkey.net/c2/ the getuser.php file : <?php $q=$_GET["q"]; $con = mysql_connect('localhost', '', ''); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("", $con); $sql="SELECT DISTINCT model FROM cars WHERE producer = '".$q."'"; $result = mysql_query($sql); echo "<select name='models'>"; while($row = mysql_fetch_array($result)) { echo "<option>" . $row['model'] . "</option>"; } echo "</select>"; mysql_close($con); ?> Whats wrong? why it does not work in IE? Link to comment https://forums.phpfreaks.com/topic/135939-php-ajax-basic-help-is-needed-on-ie5/ Share on other sites More sharing options...
priti Posted December 10, 2008 Share Posted December 10, 2008 it worked on IE 7 Link to comment https://forums.phpfreaks.com/topic/135939-php-ajax-basic-help-is-needed-on-ie5/#findComment-711353 Share on other sites More sharing options...
rhodesa Posted December 10, 2008 Share Posted December 10, 2008 what "doesn't work" about it? works fine for me in IE6 too Link to comment https://forums.phpfreaks.com/topic/135939-php-ajax-basic-help-is-needed-on-ie5/#findComment-711372 Share on other sites More sharing options...
rhodesa Posted December 10, 2008 Share Posted December 10, 2008 i gave it another look through, and saw some issues. try this instead: <html> <head> <script src="selectuser.js"></script> </head> <body> <form name="form" action="#"> <script type="text/javascript> function getText ( selectNode ) { return selectNode.options[selectNode .selectedIndex].text; } </script> Select a User: <select name="users" id="users" onchange="showUser(getText(this));"> <option>Manufacturer...</option> <option>Audi</option><option>Susita</option><option>Donkey</option></select> <div id="models"> <select name="models2" id="models2" onchange="alert(getText(document.getElementById('users'))+'-'+getText(this))"> <option>Models...</option> <option>Choose manufacturer first...</option> </select> </div> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/135939-php-ajax-basic-help-is-needed-on-ie5/#findComment-711377 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.