hello,
I am trying to acomplish the above task with a combination of php and javascript. Using the following code i am able to select the info i need and it’s stored in an array $MENU. the drop down menu is populated correctly with the names. how can i extract the necessary data when a selection is made and pass it to the javascript function?
<?php
$query=”SELECT * FROM drivers order by Name”;
$result=mysql_query($query);
$num=mysql_numrows($result);
while ($row = mysql_fetch_object($result)){
$NameN = $row -> Name;
$MENU[$NameN][‘TruckN’] = $row -> Truck;
$MENU[$NameN][‘TrailerN’] = $row -> Trailer;
$MENU[$NameN][‘PhoneN’] = $row -> Phone;
}
mysql_free_result($result);
mysql_close();
?>
<tr class=”bodyClass”>
<td><div align=”center”>
<form name=”form” method=”post” action=”editdriver1.php”>
<?php
echo “<select id=”NameN” name=”NameN” onchange=”update()” class=”a_class”>n”;
echo “<option value=”0″ selected >Choose a driver</option>n”;
foreach ($MENU as $_KEY => $
echo “<option value=””.$_KEY.””>”.$
}
echo “</select>n”;
?>
</div></td>
<td><div align=”center”>
<input name=”TruckN” id=”TruckN” type=”text” value=”” class=”a_class” />
</div></td>
<td><div align=”center”>
<input name=”TrailerN” id=”TrailerN” type=”text” value=”” class=”a_class” />
</div></td>
<td><div align=”center”>
<input name=”PhoneN” id=”PhoneN” type=”text” value=”” class=”a_class” />
</div></td>
</tr>
</table>
<p> </p>
<table width=”20%” border=”0″>
<COLGROUP span=”2″ width=”0
<tr>
<td><div align=”center”>
<input type=”submit” class=”bUgi” name=”Update” value=”Update”>
</form>