This is my codes

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript" type="text/javascript" src="js/mootools.js"></script>
<script language="javascript" type="text/javascript" src="js/getchqno.js"></script>

<script type="text/javascript">
function buildSelect(select, options)
    var select = $(select);
    options.each(function(item) {
        if($type(item) != "array")
            item = [item, item];
            var option = new Element("option", {
                text: item[0].toString(),
                value: item[1].toString()

function domready()
    $('master').addEvent('change', master_changed);

function master_changed()

    var req = new Request.JSON({
        url: 'getowner.php',
        method: 'post',
        data: 'id=' + encodeURIComponent($('master').get('value'))
    req.addEvent('success', function(response) {
        buildSelect('slave', response);

window.addEvent('domready', domready);
<form action="" method="post" name="F21" id="F21">
    <select name="make" id="master">
      <option selected="selected" >d1</option>
       $sql="SELECT *
FROM `customers`";
		while ($info=mysql_fetch_array($result)){
			$id= $info['id'];
			$name = $info['fname']." ".$info['lname'];
			echo '<option value="'.$id.'">'.$name.'</option>';
    <select name="model" id="slave">

if i added this two files to this files my codes are not working

<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src=".../js/jquery.min.js"></script>

can any one help me to solve this problem i am a new one in JS

8 Years
Discussion Span
Last Post by ruwanaru

Did you check where you copied the files. Maybe they are in a different folder then you specified.

yes i checked that their is no error in their


What is it supposed to do, and is it possible to see it somewhere in action online ?

im sorry about that what i want is when i select a value in a select (list/menu)
i want to get from relevant data to a another select (list/menu)

but i used this codes in a another place that is working if i removed that two files from my coding then this cods are working but iwant this two files also

here is the files that i used (Attached)

Edited by ruwanaru: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.