Can't figure out why this isn't working, trying to update age feild based on the selected name from the drop down.. but i get a javascript error saying object expected line 18, when i chooe a dropdown option..
thanx in advance..
Heres the code;
<?php
mysql_connect (localhost, root, "");
mysql_select_db (Test_D😎;
$res = mysql_query ("SELECT * FROM T");
?>
<head>
<!---
<script language="JavaScript">
function fill(val) {
var id = val;
var age = window.documnet.id.age;
windox.document.test.age.value = age;
}
</script>
--->
</head>
<body>
<form name=test>
<select name=drp onChange=fill(window.document.test.drp.options.value);>
<option value= ></option>
<?PHP
$x = "0";
while ($a = mysql_fetch_array($res))
{
$name = $a["Name"];
$age = $a["Age"];
$gen = $a["gender"];
echo "var $x = new array($name, $age, $gen); ";
echo "<option value=$x>$name</option>";
$x++;
}
?>
</select>
<input type=text name=age value=>
<input type=text name=gender value=>
</form>
</body>