If I have a couple fields, for example price and quanity for each product what would be a good way to add the total for each product? A working example, say I have three products: computer, mouse, keyboard and I want to buy 1 computer, 2 miceand 3 keyboards.
I know the price is static but the quanity can change, when a quanity changes I want the user to be able to hit a recalculate total and it adds up the price of the computer + the price of the 2 mice and the 3 keyboards.
So the total would be ($100 X 1) + ($10 X 2) + ($5 X 3) = $135, but if a user wants another keyboard it should make the total $140 when the click the button. Any suggestions on how to gather all the variables and then add it up?
Thanks in advance for any advice, it's appreciated.