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? Quote Link to comment Share on other sites More sharing options...
priti Posted December 10, 2008 Share Posted December 10, 2008 it worked on IE 7 Quote Link to comment 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 Quote Link to comment 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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.