• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Checkboxes in combination with calculations

New Here ,
Nov 02, 2017 Nov 02, 2017

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

Views

261

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2017 Nov 02, 2017

Copy link to clipboard

Copied

What do you mean by "price 4"?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 06, 2017 Nov 06, 2017

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines