The following page is a test for a form that is meant to accept extra
order information for certain products:
http://www.humanedge.biz/tim/testtotals.htm
The extra field at the bottom is meant to show the total quantity for an
order, but due to the way the form is processed I had to put it on a
seperate form that seems to interfere with the function I use to show the
totals.
The function is as follows:
function CalculateTotal(frm) {
var Total_Quantity = 0
for (var i=0; i < frm.elements.length; ++i) {
form_field = frm.elements[i]
form_name = form_field.name
if (form_name.substring(0,8) == "Quantity") {
item_quantity = parseInt(form_field.value)
if (item_quantity >= 0) {
Total_Quantity += item_quantity
}
}
}
document.TotalQuantity.value = Total_Quantity
}
No matter what format I use, it always seems to say that
'document.TotalQuantity.value' is null or not an object (I even tried
passing both forms involved to the function.)
Thanks.
--
GIT Groupie : http://gitgroupie.timchuma.com
The Twits Give Me the Shits : http://twitsgivemetheshits.timchuma.com
My Photos : http://photos.timchuma.com
Hong Kong Movie Reviews: http://hkmovies.timchuma.com