Jump to content

onchange


shan_cool

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



Link to comment
Share on other sites

  • 1 year later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.