Jump to content

Dynamic loading of list boxes using onChane


shan_cool

Recommended Posts

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 mysql


the code which i used is as follows:

Javascript

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_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 advance
shan
Link to comment
Share on other sites

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.