Sorry to bother you again guys... but I really need to have this working for tomorrow.
The options of a select box are gathered from a table of mysql. And when an option is selected, copy the value of it to a text input.
The query is saved into a variable, but I need to get a certain row information from it... and I don't know how. I already went to php.net and other websites, but cant find the answer.
I currently have this:
code:
<html><head>
<script language="javascript">
function select(id) {
document.forma.docname.value=
}
</script>
</head><body>
<?php
require ('connect.php');
?>
<form name="forma">
Medicamento: <br>
<select name="medica" size=5 onselect="(select(this))";>
<?php
$db['query'] = mysql_query('SELECT * FROM doctores');
while ($db['process'] = mysql_fetch_assoc($db['query'])) {
echo ('<option value="'.$db["process"]["id"].'">'.$db["process"]["nombre"].'</option>');
}
mysql_close();
?>
</select>
<input type=text style="width:100px;" name="docname"><br>
</form>
</body></html>
Obviously the javascript part wont work, im stuck there. Any ideas?
Any help will be greatly appreciated.