Copy link to clipboard
Copied
Hi all,
I want to create a form where you can select diverse items with checkboxes. Each item contains two prices: price 1 and price 2, and one complete price: price 3 (=price1+price2).
At the end of the form, a total price of all the selected items should be calculated.
My main question now is how I can set price 3 to the value 0 when the checkbox is unchecked and how to make it calculate price 4 as soon as the checkbox is checked (so that the total price at the end doesn't get influenced by unchecked items)?
My javascript isn't that good, so I hope someone can help
Thanks
Copy link to clipboard
Copied
What do you mean by "price 4"?
Copy link to clipboard
Copied
Sorry, it should be price 3 instead of price 4. So the value is 0 when unchecked and it gets calculated (price 1 + price 2) as soon as the checkbox get selected/checked.