shan_cool Posted March 6, 2006 Share Posted March 6, 2006 Hi All, I have 3 list boxes,The first list boxes contains the project names and the second list box contains module names and the third list box contains sub module names.All the project names,module names and its sub modules have there own separate master tables.what is expected is, if i click the project name only its respective module names shld be displayed and if i click the module name only its sub modules shld be displayed.i am able to do for 2 list boxes tht is if i select the project all its sub modules are displayed i want the same to be happend for sub modules too?i am using php with mysqlthe code which i used is as follows:Javascriptfunction window_onload() { var qs=location.search.substring(1,location.search.length); var pair = qs.split('='); temp = unescape(pair[1]).split('+'); document.form1.prd_name.value=temp; }function Product_onblur() { var my_prd= ""; var index1=document.form1.prd_name.selectedIndex my_prd=document.form1.prd_name.options[index1].value window.location.href = unescape("log_defect.php"+"?prod_name="+my_prd); } php code: <select style="border-style:none; FONT-SIZE: 10pt; WIDTH: 137px; COLOR: #222222; " name="prd_name" style="font-size: 10pt" tabindex="2" onChange="return Product_onblur()"> <?php $query=mysql_query("SELECT prod_name name FROM dt_product order by prod_name ASC",$connection )or die ("cant do it"); while ($result=mysql_fetch_array($query)) { echo '<option value="' . $result['name'] . '">' . $result['name'] . '</option>'; } ?> </select>can anybody help me,Thanks in advanceshan Quote Link to comment https://forums.phpfreaks.com/topic/4188-dynamic-loading-of-list-boxes-using-onchane/ 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.