I have forms and I only need to input is the Demanded Qty, and from Demanded Qty that I input it will compute the demanded qty for each Item Code.

Now my problem is I don't know on how can it possible that while i input the quantity it will also autodisplay the demanded qty for each materials.

Noted: the Demanded Qty that will auto display is display only on the Demanded Qty you input per Items.
For Example:

On Item = P28 i input demanded qty, only on the ItemCode will display the output.

and when i input on P30 the computation will display on the ItemCode for P30.

here is my code:

PHP Code:
date_default_timezone_set("Asia/Singapore"); //set the time zone  
$con mysql_connect('localhost''root','');

if (!
$con) {

<title>Stock Requisition</title>
<link rel="stylesheet" type="text/css" href="kanban.css">

<script type="text/javascript">
function compute_quantity(){
    var DemandedQty = document.getElementById('DemandedQty').value;
    var Quantity = document.getElementById('Quantity').value;
    var SubQty = (DemandedQty * Quantity);
<form name="stock_requisition" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<th>Sub Items</th>
<th>Item Code</th>
<th>Demanded Qty</th>
<th>BIN Location</th>


$sql "SELECT DISTINCT Items FROM bom_subitems ORDER BY Items";
$res_bom mysql_query($sql$con);

$row mysql_fetch_assoc($res_bom)){
$Items $row['Items'];
$Items_ substr($Items123);
        <td style='border: none;font-weight: bold;'>&nbsp;<input type='name' value='
$Items_' name='Items_[]' id='Items' readonly = 'readonly' style = 'border:none;width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;'></td>
        <td style='border:none;'>&nbsp;</td>
        <td style='border:none;'>&nbsp;</td> 
        <td style='border: none;'><center><input type='text' name='DemandedQty[]' id='DemandedQty' value='' size='12' onkeypress = compute_quantity()></center></td>     

$sql "SELECT Items, SubItems, ItemCode, UoM, Class, Description, BINLocation, Quantity FROM bom_subitems WHERE Items = '$Items' ORDER BY Items"or die(mysql_error());

$res_sub mysql_query($sql$con);  
$row_sub mysql_fetch_assoc($res_sub)){

$Items1 $row_sub['Items'];
$SubItems $row_sub['SubItems'];
$ItemCode $row_sub['ItemCode'];
$UoM $row_sub['UoM'];
$Class $row_sub['Class'];
$Description $row_sub['Description'];
$BINLocation $row_sub['BINLocation'];
$Quantity $row_sub['Quantity']; 
"<input type='hidden' name='Quantity' id='Quantity' value='$Quantity'>";
        <td style='border: none;'>&nbsp;<input type='hidden' value='
$Items1' id='Items1' name='Items1[]'></td>
        <td style='border: none;'>&nbsp;<input type='text' name='SubItems[]' value='
$SubItems' id='SubItems' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;'></td>
        <td style='border: none;'>&nbsp;<input type='text' name='ItemCode[]' value='
$ItemCode' id='ItemCode' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;'></td>
        <td style='border: none;'><center><input type='text' name='SubQty[]' id='SubQty' value='' size='12' style></center></td>
        <td style='border: none;' size='3'>&nbsp;<input type='text' name='UoM[]' value='
$UoM' id='UoM' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;' size='3'></td>
        <td style='border: none;'>&nbsp;<input type='text' name='Class[]' value='
$Class' id='Class' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;'></td>
        <td style='border: none;'>&nbsp;<input type='text' name='Description[]' value='
$Description' id='Description' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;' size= '30'></td>
        <td style='border: none;'>&nbsp;<input type='text' name='BINLocation[]' value='
$BINLocation' id='BINLocation' readonly='readonly' style='border:none; width:auto;font-family: Arial, Helvetica, sans-serif;font-size: 1em;'></td>     

Thank you so much