<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Everyone,<br>
<br>
I hope you are enjoying your weekend and not working too hard.<br>
<br>
I'm still trying to get my head around js, and was hoping someone may
have some insights to help me with the next steps on a form I am
creating.<br>
<br>
I have an order form that is going to be dynamically created.<br>
I am able to successfully pass the quantity value upon user input for
field 1.<br>
Basically I'm using onchange() to pass the quantity value to the script.<br>
The id of the price field is of the format unit-price-0, unit-price-1,
etc.<br>
Each line item's subtotal should update before going onto the next line
item.<br>
<br>
Here's the js function. Each line item has its own unit-cost, quantity,
and subtotal.<br>
Any help would be so appreciated.<br>
<br>
One suggestion was to "have form api write those hidden fields after
each element is created"<br>
Not sure how to accomplish that.<br>
<blockquote>function calcPrice() {<br>
<br>
// Get the Quantity From Form Field //<br>
unitCost = document.getElementById ('edit-price-0').value; <br>
theQty = document.getElementById ('edit-quantity').value;<br>
<br>
subOrderCost = theQty * unitCost;<br>
<br>
//Line Item Cost //<br>
subtotalCost = subOrderCost;<br>
//<br>
subtotalCostDisplay = addCommas(subtotalCost.toFixed(2));<br>
//<br>
subtotalCostValue = subtotalCost.toFixed(2);<br>
//<br>
//// Display Cost To User //<br>
document.getElementById('edit-subtotal').value = "$" +
subtotalCostDisplay;<br>
}<br>
</blockquote>
<pre class="moz-signature" cols="72">--
Karyn</pre>
</body>
</html>