In the HTML, a table has a select box, it's values are using PHP to loaded from database, which call it "record_a" field in the database, and let's call other one field is "record_b" which is in the same table in the database.
I wish when the select box is selected, then "record_b" can be a value to the text box automaticly.
for example,
<td><select size="1" name="record_a">
<option></option>
<?php
<!-- load datas from database -->
$sql="select Record_A, Record_B from Record_file";
.....
.....
.....
<!-- put the loaded datas to the select box -->
printf("<option value=\"%s\">%s</option>\n", pg_fetch_result($result, $i, 0), pg_fetch_result($result, $i, 1));
}
?>
</select></td>
<td></td>
<!-- I wish this record_b value can get automaticly when record_a is selected -->
<td><input type="text" name="record_b" ></td>
</tr>
Please help.
Thanks.