Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Iterate through multidimensional control array

Status
Not open for further replies.

BiggerBrother

Technical User
Sep 9, 2003
702
GB
I don't know if this is possible, but is it possible to iterate through the following:

I have a selection of textboxes, making up a form. One of the groups of boxes is named: textbox[quantity], where i is a varible.

Currently I have the following:
var sum = 0;
var quantity = document.getElementsByName('textbox');
for(var i=0; i<quantity.length; i++)
{
sum = sum + quantity[quantity].value;
}
document.create_order.total_quantity.value=sum;
}
At the moment, quantity.length always returns 0.

Many thanks for any ideas or thoughts,

BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top