Populating text fields from dropdown
Thank you but problem is trying to do it dynamical:
See below for code, any suggestions is welcome:
<form action="orders_Insert.php" method="post" name="WADAInsertForm" id="WADAInsertForm">
<div class="WADAHeader">Add Material/Equipment for Service Request - <?php echo $row_WAREQ['reqid']; ?></div>
<table class="WADADataTable" cellpadding="0" cellspacing="3" border="0">
<tr>
<th nowrap bgcolor="#CCCCCC" class="WADADataTableHeader">* Material/Equipment:</th>
<td class="WADADataTableCell"><label for="ProductName"></label>
<select name="ProductName" id="ProductName"
onchange="document.WADAInsertForm.ProductPrice.value = document.WADAInsertForm.products[document.WADAInsertForm.products.selectedIndex].text;
document.WADAInsertForm.SKU.value = document.WADAInsertForm.products[document.WADAInsertForm.products.selectedIndex].value">
<option value="">Select a Material/Equipment</option>
<?php
do {
?>
<option value="<?php echo $row_WAProducts['ProductID']?>"><?php echo $row_WAProducts['ProductName']?></option>
<?php
} while ($row_WAProducts = mysql_fetch_assoc($WAProducts));
$rows = mysql_num_rows($WAProducts);
if($rows > 0) {
mysql_data_seek($WAProducts, 0);
$row_WAProducts = mysql_fetch_assoc($WAProducts);
}
?>
</select></td>
</tr>
<tr>
<th nowrap bgcolor="#CCCCCC" class="WADADataTableHeader">Price:</th>
<td class="WADADataTableCell"><input type="text" name="ProductPrice" id="ProductPrice" size="32" /></td>
</tr>
<tr>
<th nowrap bgcolor="#CCCCCC" class="WADADataTableHeader">SKU:</th>
<td class="WADADataTableCell"><input type="text" name="SKU" id="SKU" value="" size="32" /></td>
</tr>
</table>
<div class="WADAButtonRow">
<table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" name="Insert" id="Insert" value="Insert" alt="Insert" src="../../../WA_DataAssist/images/Pacifica/Refined_insert.gif" /></td>
</tr>
</table>
<input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="">
</div>
</form>