链式选择框jquery php

我发现这个插件为php / mysql / jquery三链选择框。 这适用于这种方法:选择第一个框是可见的! 选择任何option onload selectbox 2之后,选择任何option onload last selectbox(3)。 现在我的问题是:选择框2和3隐藏,并在prevuise选择框中选择option后显示(可见)。 我需要显示(显示)所有三个选择框,然后选择option显示结果进入选择框。

PHP函数:

 <?php //************************************** // Page load dropdown results // //************************************** function getTierOne() { $result = mysql_query("SELECT DISTINCT tier_one FROM three_drops") or die(mysql_error()); while($tier = mysql_fetch_array( $result )) { echo ''.$tier['tier_one'].''; } } //************************************** // First selection results // //************************************** if($_GET['func'] == "drop_1" && isset($_GET['func'])) { drop_1($_GET['drop_var']); } function drop_1($drop_var) { include_once('db.php'); $result = mysql_query("SELECT DISTINCT tier_two FROM three_drops WHERE tier_one='$drop_var'") or die(mysql_error()); echo ' Choose one'; while($drop_2 = mysql_fetch_array( $result )) { echo ''.$drop_2['tier_two'].''; } echo ''; echo " $('#wait_2').hide(); $('#drop_2').change(function(){ $('#wait_2').show(); $('#result_2').hide(); $.get(\"func.php\", { func: \"drop_2\", drop_var: $('#drop_2').val() }, function(response){ $('#result_2').fadeOut(); setTimeout(\"finishAjax_tier_three('result_2', '\"+escape(response)+\"')\", 400); }); return false; }); "; } //************************************** // Second selection results // //************************************** if($_GET['func'] == "drop_2" && isset($_GET['func'])) { drop_2($_GET['drop_var']); } function drop_2($drop_var) { include_once('db.php'); $result = mysql_query("SELECT * FROM three_drops WHERE tier_two='$drop_var'") or die(mysql_error()); echo ' Choose one'; while($drop_3 = mysql_fetch_array( $result )) { echo ''.$drop_3['tier_three'].''; } echo ' '; echo ''; } ?> 

JS和索引PHP:

 include('db.php'); include('func.php');  $(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; }); }); function finishAjax(id, response) { $('#wait_1').hide(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); } function finishAjax_tier_three(id, response) { $('#wait_2').hide(); $('#'+id).html(unescape(response)); $('#'+id).fadeIn(); }   

Select a Category Please Wait Please Wait

感谢任何帮助.u可以告诉我任何前任和演示,我的意思是这个。