Jump to content

Archived

This topic is now archived and is closed to further replies.

shan_cool

onchange

Recommended Posts

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 validation
function 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



Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.