I am currently producing a system in which I want the user to be able to select the product name from a drop-down menu and when selected I would like the barcode to appear in the barcode field. I would really appreciate any help, however great or small.
The current code which I have for this is: -
<td colspan="5" class="table_text">Product Information:</td>
</tr>
<tr>
<td width="10%" align="left"> </td>
<td width="30%" align="left">Barcode</td>
<td width="30%" align="left" >Product</td>
<td width="30%" align="left" >Quantity</td>
</tr>
<tr>
<td align="right"><input type="checkbox" name="chk" id="chk" /></td>
<td colspan="-3" align="center"><input name="barcode" type="text" id="barcode" value="<?php ?>" readonly="readonly" /></td>
<td align="left"><select name="product" id="product">
<option value="--- Select Department ---">--- Select Product ---</option>
<?
// Get records from database (table "name_list").
$list=mysql_query("select * from `lines` order by barcode asc");
// Show records by while loop.
while($row_list=mysql_fetch_assoc($list)){
?>
<option value="<? echo $row_list['barcode']; ?>" <? if($row_list['barcode']==$select){ echo "selected"; } ?>><? echo $row_list['product']; ?> </option>
<?
// End while loop.
}
?>
</select></td>
<td><input type="text" name="quantity" id="quantity" /></td>