Using If statements in a Caldera Forms Manual Formula
-
Hi. I wonder if you can help me with a novice question. I’m trying to use a manual formula in a Caldera forms, but my Javascript skills are not good.
I have a form with the following fields
Unit Price for under 10 items
Unit Price for Over 10 items
Quantity Required
Total Price
Total Price DiscountedMy Formula for Total Price is……..%unit_price_for_under_10_items% * %quantity_required%
This works fine ( I realise that I could have used Operator Groups to do this, but I’m just exploring the software).
My formula for Total Price Discounted is…….
if (%quantity_required%>10%) {unit_price_for_over_10_items% * %quantity_required%}
else {unit_price_for_under_10_items% * %quantity_required%}
This doesn’t work and just returns a blank value when I preview the form. I have 2 questions
1. Is it possible to use <if> statements in manual formulae like this, or is there a better way to achieve the same thing?
2. If it is possible, could you tell me what the correct syntax for my Total Price Discounted formula should be?
- The topic ‘Using If statements in a Caldera Forms Manual Formula’ is closed to new replies.