shan_cool Posted February 27, 2006 Share Posted February 27, 2006 hi,I should hav a screen where i first select the project Name and onchange of it i shld get its respective product name and if i select a product name and onchange of it ,i shld get its respective module names.I tried first for a single on where the project name is assumed to be one and its respective products are displayed and if i select the product name,its respective modules are displayed,This works fine but if i implent the same for project name as well it does work.My code ://Javascript validationfunction 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_defect1.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 $prj_nam=$_GET[prj_name]; $query=mysql_query("SELECT prod_name name FROM dt_product where proj_name='$prj_name' 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?If i am not clear,let me know?Thanks in advance,Shan_cool Link to comment https://forums.phpfreaks.com/topic/3659-onchange/ Share on other sites More sharing options...
brissy_matty Posted June 1, 2007 Share Posted June 1, 2007 I have it in Ajax if that's helpful - or i can change it to just be java? Link to comment https://forums.phpfreaks.com/topic/3659-onchange/#findComment-266237 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.