My conditional calculation for a field is not working

  • thelittleyurtmeadow
    Asked on June 21, 2016 at 9:30 AM

    Can someone please advise why the conditions in {totalCost36} won't work together please?

     

     

  • Welvin Support Team Lead
    Replied on June 21, 2016 at 12:20 PM

    The calculation is working as far as my test is concerned. Can you tell us what condition is not working?

    My conditional calculation for a field is not working Image 1 Screenshot 20

  • thelittleyurtmeadow
    Replied on June 22, 2016 at 4:45 AM

    The condition where you enter a discount code of "WEEKDAY20" to put 20% off the accommodation price. 

     

    see screen printsMy conditional calculation for a field is not working Image 1 Screenshot 40

     

    My conditional calculation for a field is not working Image 2 Screenshot 51

     

     

    also these three boxes are just not appearing.

     

     

     

    My conditional calculation for a field is not working Image 3 Screenshot 62

     

    I've changed around the conditions slightly but can't check them as box wont appear

  • Welvin Support Team Lead
    Replied on June 22, 2016 at 7:02 AM

    Your condition seems to be working. Here's a screenshot of the fields:

    My conditional calculation for a field is not working Image 1 Screenshot 20

    You have a condition that if WEEKDAY20 is applied in the Discount Code, the Total Discounted Price calculation will be pass to the final_cost. As you could see, it's working. If this is not the conditional that you want to have, please let us know how you would like it to calculate/update.

    I'd also appreciate if you can give us some steps on how to replicate the problem if the above is not correct. 

    The Total cost of stay is not yet calculated based on your form so that stays empty. 

  • thelittleyurtmeadow
    Replied on June 22, 2016 at 8:50 AM

    the condition that if WEEKDAY20 is applied in the Discount Code, theTotal Discounted Price calculation will be pass to the final_cost.

    the condition that if  the Discount Code box is empty, the normal_cost calculation will be pass to the final_cost.

    I've set up a condition in Total cost of stay so that a balance of £100, £200, or £300 will be added to the final price dependent on what option is chosen in "which yurt would you like"

    This is having problems int he calculation.

     

    My conditional calculation for a field is not working Image 1 Screenshot 30My conditional calculation for a field is not working Image 2 Screenshot 41

     

    I would also like a £ sign to appear in the total cost of stay but can't get it to do it.

  • thelittleyurtmeadow
    Replied on June 22, 2016 at 9:15 AM

    the problems seem to be in the calculations / conditions on the following:

     

    My conditional calculation for a field is not working Image 1 Screenshot 20

  • Charlie
    Replied on June 22, 2016 at 12:44 PM

    I'm sorry, your form actually has a lot of things going on in it. It's quite hard for us to understand it without you providing us specific formulas and steps on how your calculations are actually working.

    Your form has 80+ conditions, with a mixed of "Show" and "Insert" actions, you also have direct formulas on the form calculation widgets. You also have a lot of hidden text boxes that holds values for the calculation.

     

    This is what I have observed.

    "Amount due to pay" is fetched from "Cost calculation dependent on DATE

    "Cost calculation dependent on DATE" gets value from "Total cost of stay" / 2 when "Arrival Date" is equal to today + 30.

    My conditional calculation for a field is not working Image 1 Screenshot 50

     

    Now, "Total cost of stay" is DEPENDENT on final_cost:

    My conditional calculation for a field is not working Image 2 Screenshot 61

    If that's the case, then remove the formula you added directly in the form calculation widget to avoid conflict.

     

    Now final_cost is dependent on your conditions:

    My conditional calculation for a field is not working Image 3 Screenshot 72

     

     

    Here are my observations, here's my cloned form and I edited it, see if that works as you expected: https://www.jotformpro.com/form/61734631534959 

    These are the changes I made:

    1. Remove the "Default" value "£", it might caused problems.

    2. The calculation on "Cost calculation dependent on DATE" will only happen if the date is current day + 30 days. Please note that if it's not equal to that date, then there's no value that will be inserted on that field. I changed it to IF "Arrival date" is filled to further test.

    3. Remove the "£" in your conditions where you make calculations, you are passing number values and adding a text string will prevent it to make an actual calculation. Like this one:

    My conditional calculation for a field is not working Image 4 Screenshot 83

     

    You can clone my form to have a copy of it in your account so that you can better check my settings.

    I hope that helps.

  • thelittleyurtmeadow
    Replied on June 23, 2016 at 5:03 AM

    That's great thank you. I've made a few tweaks but using your clone it's worked thank you.

    Is there anyway of inputting a £ sign in the Total Cost of Stay box? so people know it's a currency figure.

  • Chriistian Jotform Support
    Replied on June 23, 2016 at 7:45 AM

    Hi,

    Based on the previous responses, you needed to remove the £ sign since it breaks the calculation so perhaps we can add it using CSS. Please inject the following CSS to your form.

    #cid_36 span.form-sub-label-container:before {

    content: "£";

        position: absolute;

        top: 37px;

        left: 22px;

    }

     

    input#input_36 {

        padding-left: 10px;

     

    }

     

    Please see How to Inject Custom CSS Codes for more details. Result should be as follows.

    My conditional calculation for a field is not working Image 1 Screenshot 20

     

    Now, I am not sure if you are still using the previous form you gave since you implied that you are already adopted my colleague's form. So if the above CSS does not work, please give us your current form.