I have the following function to get the total qty:
function calttl()
{
var ttlqty
ttlqty=0
for (i = 0; i <= document.qtymai n.orderdetail.l ength-1; i++)
{
ttlqty = ttlqty + document.qtymai n.qty.item(i).v alue
}
}
The problem I have is the document.qtymai n.qty.item(i).v alue I get
look like a string, so the number I get for ttlqty is not add up the
number but concatenate.
How do I convert the value I get to a number in javascript?
Thanks for any help in advance.
Amy
function calttl()
{
var ttlqty
ttlqty=0
for (i = 0; i <= document.qtymai n.orderdetail.l ength-1; i++)
{
ttlqty = ttlqty + document.qtymai n.qty.item(i).v alue
}
}
The problem I have is the document.qtymai n.qty.item(i).v alue I get
look like a string, so the number I get for ttlqty is not add up the
number but concatenate.
How do I convert the value I get to a number in javascript?
Thanks for any help in advance.
Amy
Comment