Modify the function tallyRow() to update the total column
value at the bottom of table.
The Code
function tallyRow()
{
z=document.orderform.countTtl.value; // hidden value of db recordset count
//alert(z) // use for testing
x=0;y=0;Cost=0;Total=0;ttlQuant=0; // Globals
for (i=1;i<=z;i++) // loop through rows
{ // Use Eval function to dynamically build the column name
x=eval("document.orderform.quantity_"+ i +".value"); // x is quantity
y=eval("document.orderform.price_"+ i +".value"); // y is price
Cost = (x*y); // simple calcualtion
//Pass value of calculation back as 2 decimal value - use __.toFixed(2) function //nX = nX.toFixed(2)
document.getElementById("row_ttl_" + i ).value = Cost.toFixed(2);
Total=Total+Cost; // Add new col total to old col total
document.orderform.Total.value = Total.toFixed(2); // Pass value to table
}
}
. . . H T M L . . .