Hi,

I'm having trouble figureing out the last part of this problem. I'am using a
javascript function to give me a grand total price for all the items in the
boxes (item quantity * item price). What I can't figure out is how to get each
price to display individualy in each seperate box.

I've attatched some code, to hopefully clarify what I'm talking about. Thank
you in advance!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>
<script language="JavaScript" type="text/javascript">
<!--
function CalculateOrder(frm)
{
var order_total = 0
var item_total = 0
// run through all the form fields
for (var i=0; i < frm.elements.length; ++i)
{
// get current field
form_field = frm.elements[i]

// get field's name
form_name = form_field.name

// "quantity" field?
if (form_name.substring(0,3) == "qty")
{
// get the quantity
item_quantity = form_field.value
}
//"cost" field?
if (form_name.substring(0,4) == "cost")
{
//get price
item_price = form_field.value

if (item_quantity >= 0)
{
order_total += item_quantity * item_price
}
}
if (form_name.substring(0,5) == "total")
{
item_total == item_quantity * item_price
item_total = form_field.value
}
}
// display total
frm.grandtotal.value = order_total
frm.total.value = item_total

}
//-->
</script>
<body>
<form>
<table cellspacing="2" cellpadding="2" border="1">
<tr>
<td colspan="2" valign="top"><strong>D.</strong></td>
<td colspan="2" valign="top"><strong>E. Purchases Only</strong></td>
</tr>
<tr>
<td valign="top"><strong>ITEM</strong></td>
<td valign="top"><strong>QTY</strong></td>
<td valign="top"><strong>COST</strong></td>
<td valign="top"><strong>TOTAL</strong></td>
</tr>
<tr>
<td valign="top"><input type="text" size="40" name="item1"></td>
<td valign="top"><input type="text" size="5" name="qty1"></td>
<td valign="top"><input type="text" size="10" name="cost1"
onChange="CalculateOrder(this.form)"></td>
<td valign="top"><input type="text" size="10"
name="total2"onFocus="this.form.total.focus()"></td>
</tr>
<tr>
<td valign="top"><input type="text" size="40" name="item3"></td>
<td valign="top"><input type="text" size="5" name="qty3"></td>
<td valign="top"><input type="text" size="10" name="cost3"
onChange="CalculateOrder(this.form)"></td>
<td valign="top"><input type="text" size="10"
name="total3"onFocus="this.form.total.focus()"></td>
</tr>
<tr>
<td valign="top"><input type="text" size="40" name="item4"></td>
<td valign="top"><input type="text" size="5" name="qty4"></td>
<td valign="top"><input type="text" size="10" name="cost4"
onChange="CalculateOrder(this.form)"></td>
<td valign="top"><input type="text" size="10"
name="total4"onFocus="this.form.total.focus()"></td>
</tr>
<tr>
<td valign="top"><input type="text" size="40" name="item5"></td>
<td valign="top"><input type="text" size="5" name="qty5"></td>
<td valign="top"><input type="text" size="10" name="cost5"
onChange="CalculateOrder(this.form)"></td>
<td valign="top"><input type="text" size="10"
name="total5"onFocus="this.form.total.focus()"></td>
</tr>
<tr>
<td valign="top"><input type="text" size="40" name="item6"></td>
<td valign="top"><input type="text" size="5" name="qty6"></td>
<td valign="top"><input type="text" size="10" name="cost6"
onChange="CalculateOrder(this.form)"></td>
<td valign="top"><input type="text" size="10"
name="total6"onFocus="this.form.total.focus()"></td>
</tr>
<tr>
<td valign="top"><input type="text" size="40" name="item7"></td>
<td valign="top"><input type="text" size="5" name="qty7"></td>
<td valign="top"><input type="text" size="10" name="cost7"
onChange="CalculateOrder(this.form)"></td>
<td valign="top"><input type="text" size="10"
name="total7"onFocus="this.form.total.focus()"></td>
</tr>
<tr>
<td colspan="3" align="right" valign="top"><strong>TOTAL COST</strong></td>
<td valign="top">$ <input type="text" size="8" name="grandtotal"
onFocus="this.form.elements[0].focus()"></td>
</tr>
</table>
</form>

</body>
</html>