Hi all,
I have a Select Menu.
When the user selects from it relevant data is called from a Database.
Based on the users selection I want two textfields to be populated with relevant database data.
So textfield_one will automatically be populated with inv_note data;
textfield_two will automatically be populated with inv_note2 data.
inv_note and inv_note2 are related to investment_type_ID.
Below is my work so far. But I am stuck as to where to go from here. How do I use the below data in the arrays to automatically populate the textfields?
Thanks.
1/ Get Data From Database:
// 1) Get all Investment Types
$query = "SELECT investment_type_ID, investment_type, inv_note, inv_note2 ".
"FROM investment_type";
$result = mssql_query($query) or die('Select Error');
2/ Set Option Values and Populate Arrays with relevant Database Data
while($row = mssql_fetch_array($result))
{
// option string
$option .= '<option value="'.$row['investment_type_ID'].'">'.$row['investment_type'].'</option>';
// arrays to build javascript array string
$type1_array[] = $row['inv_note2'];
$type_array[] = $row['inv_note'];
$id_array[] = $row['investment_type_ID'];
}// end while