I have a script working to populate a drop down menu for a field with values coming from a table within my database, however, I would like the selection choice to also automatically complete the next field in the table with a value.
Here's the code I am using after connection to the database:
echo '<td width="16%"><select name="file_id" size="1" tabindex="2">';
echo "<option value=\"\"></option>";
$query2 = "SELECT * FROM retention order by file_id";
$result2 = mysql_query ($query2);
while ($row2=mysql_fetch_array($result2)) {
$file_id=$row2["file_id"];
echo "<option value=\"$file_id\">$file_id</option>";
}
echo '</select>';
echo ' </td>';
This works great but as I say I need to automatically select a value in the next field (same table and row as the above) upon a selection being made using this script.
Can it be done with the same script or will I need something different to complete this task.
Any ideas or sample scripts appreciated.
Thanks.