Help Needed for Custom Javascript Calculations Product Order Form
- June 27, 2022
- 1 reply
- 2071 views
Trying to get a total sum based on a particular variable in the backend of my javascript calculations on an product order form.
So on a product order form, there's a text field for quantity (no. of panels) and a checkbox (with the base price added to it).
When the checkbox is selected, the standard base price is added in the format properties (£300) and appears in one of the 'total' textfields. However the part I'm having difficulty with is having the quantity number determining what the total sum is based on a specific additional price(s).
Example: The aluminium base is £300.00 when checked. When the quantity for no. of panels is set to 2, the number should remain the same at £300. When the quantity is 3 panels, this needs to add an additional £40.00, totalling £340.00. If 4 is entered for the number of panels, that should add another £80.00 on top of it (total being £380.00), if 5 is typed into the quantity box, £120.00 needs to be added to the £300, totalling £420.00) and so on.
Aluminim base checkbox is "AluBase" while the quantity textfield is "NoPanels".
Now how do I create the correct javascript custom calculation/simplified field notion calculation to achieve this?
