Question
How to get a total from forms
Hi, I'd like to be able to total the results of a form.
I have a number of items that were generated from a database, I have a select for the quantity of each item listed. next I want to total the price dynamically based on the item price x quantity, looping through all the items in the list. when I do a dump of the form this is what I get
4 - 3
FIELDNAMES - 1,2,3,4,ORDER1
ORDER1 - order1
1 - 4
2 - 2
3 - 0
FIELDNAMES 1,2,3,4 represent the ITEM ID and the number next to it represents the quantity ordered. (4 - 3 means item ID 4 has a total of 3) so now I'm not sure what to do, how do I run a select based on unknown formfields. or is there another way to get this done?
I have a number of items that were generated from a database, I have a select for the quantity of each item listed. next I want to total the price dynamically based on the item price x quantity, looping through all the items in the list. when I do a dump of the form this is what I get
4 - 3
FIELDNAMES - 1,2,3,4,ORDER1
ORDER1 - order1
1 - 4
2 - 2
3 - 0
FIELDNAMES 1,2,3,4 represent the ITEM ID and the number next to it represents the quantity ordered. (4 - 3 means item ID 4 has a total of 3) so now I'm not sure what to do, how do I run a select based on unknown formfields. or is there another way to get this done?
