Dependent and autocomplete form fields in IE

eddiehedgehog

New Member
I need two dependent fields that will be used when filling the autocompletions.I modified the code from the [http://www.blueicestudios.com/chained-sele...php-mysql-ajax/][1] I have now:index.php\[code\]<pre><code><script language="javascript" type="text/javascript">$(document).ready(function() { $('#wait_1').hide(); $('#drop_1').change(function(){ $('#wait_1').show(); $('#result_1').hide(); $.get("func.php", { func: "drop_1", drop_var: $('#drop_1').val() }, function(response){$('#result_1').fadeOut(); setTimeout("finishAjax('result_1', '"+escape(response)+"')", 400);}); return false; }).trigger('change');}); function finishAjax(id, response) { $('#wait_1').hide(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn();}</script>Option 1: <?php getTierOne(); ?><span id="wait_1" style="display: none;"></span>Option 2: <span id="result_1" class="person_form" ></span> </code></pre>\[/code\]file func.php\[code\]<pre><code><?phpfunction getTierOne(){?><script type="text/javascript">$(document).ready(function() {$("#drop_1").autocomplete({ minLength: 2, source: [<?php mysql_connect('localhost', 'root', 'pass') or die(mysql_error()); mysql_select_db('base') or die(mysql_error());mysql_query('SET NAMES utf8');$result = mysql_query('SELECT DISTINCT option1 FROM city') or die(mysql_error());while($tier = mysql_fetch_array( $result )) {echo "'.$tier['option1'].'",';}?>]}).focus(function () { $(this).autocomplete("search", ""); return false;});});</script><?php echo '<input name="drop_1" id="drop_1" value="" />';}if (isset($_GET['func'])&& $_GET['func'] == 'drop_1' ) {drop_1($_GET['drop_var']);}function drop_1($drop_var){ ?><script type="text/javascript">$(function(){ $("#tier_two").autocomplete({ minLength: 0, source: [<?php mysql_connect("localhost", "root", "pass") or die(mysql_error());mysql_select_db("base") or die(mysql_error());mysql_query('SET NAMES utf8');$result = mysql_query("SELECT * FROM city WHERE option1='$drop_var'") or die(mysql_error()); while($drop_2 = mysql_fetch_array( $result )) {echo '"'.$drop_2['option2'].'",';}?>]}).focus(function () { $(this).autocomplete("search", ""); return false;});});</script><?php echo '<input name="tier_two" id="tier_two" value="" />';}</code></pre>\[/code\]In FF works fine, but in IE will not work. I do not know much about javascript, Help please.I'm sorry for my english :)
 
Back
Top