CassidyHunt
IS-IT--Management
I have a web application that I can't seem to get over the hump of how to make it work.
I need to create an array of fields like this:
Where the trick is is that I do not ever really know how many fields there are going to be and I need to use them to make an array of an item. Using the same example as above I would need this:
item 1
qty = 5
description = This is an item
Price = $25.00
Weight = 5lbs
Then I need to create an array of those items
group 1
item 1
qty = 5
description = This is an item
Price = $25.00
Weight = 5lbs
item 2
qty = 3
description = This is an item 2
Price = $2.00
Weight = 1lbs
group 2
item 1
qty = 5
description = This is an item
Price = $25.00
Weight = 5lbs
item 2
qty = 3
description = This is an item 2
Price = $2.00
Weight = 1lbs
Then I would need an array of the groups. I am struggling on how to make this all dynamic in javascript. I guess I do not understand how I would access the array structure.
Any ideas or direction would help.
Thanks
Cassidy
I need to create an array of fields like this:
Code:
var fields = new Array('Qty','Description','Price','Weight');
Where the trick is is that I do not ever really know how many fields there are going to be and I need to use them to make an array of an item. Using the same example as above I would need this:
item 1
qty = 5
description = This is an item
Price = $25.00
Weight = 5lbs
Then I need to create an array of those items
group 1
item 1
qty = 5
description = This is an item
Price = $25.00
Weight = 5lbs
item 2
qty = 3
description = This is an item 2
Price = $2.00
Weight = 1lbs
group 2
item 1
qty = 5
description = This is an item
Price = $25.00
Weight = 5lbs
item 2
qty = 3
description = This is an item 2
Price = $2.00
Weight = 1lbs
Then I would need an array of the groups. I am struggling on how to make this all dynamic in javascript. I guess I do not understand how I would access the array structure.
Any ideas or direction would help.
Thanks
Cassidy