How to set the if condition to make the calculator work?

  • GennieM
    Asked on February 16, 2018 at 8:13 AM

    I have an order form set to have the following variables affecting price: Urgency, level and Spacing. How do I set the if condition to make the calculator work and give the correct values. I have hit a dead end. Thank you.


    Jotform Thread 1386803 Screenshot
  • Richie JotForm Support
    Replied on February 16, 2018 at 10:10 AM

    I checked your condition and I can't seem to understand how to derive your formula.

    Can you give me an example of your flow and the calculation to derive the to the total value?

    For the meantime, We can use Form Calculations to get the your calculation values.

    How to set the if condition to make the calculator work? Image 1 Screenshot 40

    and add a formula, lets say urgency * number of pages.

    How to set the if condition to make the calculator work? Image 2 Screenshot 51

    Here is a sample screen cast.

    How to set the if condition to make the calculator work? Image 3 Screenshot 62

    Thank you.


  • GennieM
    Replied on February 16, 2018 at 4:23 PM

    Yeah, I think I have too many conditions that are making the logic complex. But the main thing is to calculate the price which is changing based on three variables. that is level, urgency and spacing.

    Price = Cost at selected level, urgency and spacing multiplied by the Number of pages. So if a user inputted the following Values

    Level: High school

    urgency: 14 Days

    Pages: 5

    The cost would be 10*5=50

    I have a problem in using the if condition to make the calculator select the two numbers. Is there a way around that?

    Thanks for your response and further assistance will be apreciated

  • Richie JotForm Support
    Replied on February 16, 2018 at 4:45 PM

    You can use the Form calculation widget to select the proper values.

    -Form+Calculations

    How to set the if condition to make the calculator work? Image 1 Screenshot 40

    I checked your form and for the number of pages, you have different calculation values, from your example given pages: 5 has a value of 60 in your form.

    How to set the if condition to make the calculator work? Image 2 Screenshot 51

    Level of  work has its own calculation values.

    How to set the if condition to make the calculator work? Image 3 Screenshot 62

    Here is my cloned form.https://form.jotform.com/80464268607967

    Hope this information helps.


    Please let us know if we can be of further assistance.

  • GennieM
    Replied on February 16, 2018 at 6:40 PM

    I'm yet to crack this! The many tutorials notwithstanding. Any better way?

  • Mike
    Replied on February 16, 2018 at 9:11 PM

    You can use separate fields to be able to use them in calculations.

    How to set the if condition to make the calculator work? Image 1 Screenshot 30

    Show the appropriate field based on the conditional logic.

    How to set the if condition to make the calculator work? Image 2 Screenshot 41

    Here is a sample form:

    https://form.jotform.com/80467487874979

    You can clone it to your account:

    How to Clone an Existing Form from a URL

  • GennieM
    Replied on February 17, 2018 at 6:15 AM

    Thanks Mike, I've just cloned the form. Now is it possible to pass calculation value from one form to another so as to have Payment through Stripe or Paypal? Can the form be used in a Wordpress Site?

  • Ardian_L
    Replied on February 17, 2018 at 7:23 AM

    If you want to have more than one payment on the form you need to follow the instructions from the link below:

    https://www.jotform.com/help/182-How-to-Create-a-Basic-Multiple-Payment-Form

    Yes the form can be used on a WordPress Site. You have some methods on how to integrate your form on a WordPress site, please follow the instructions on the link below for more information:

    https://www.jotform.com/help/324-A-Guide-to-Embed-Forms-for-WordPress-Users

    Please let us know if you have any other question. Thank you!

  • GennieM
    Replied on February 17, 2018 at 11:22 AM

    My concern is on how to pass the calculated value in one form to the payment forms so that a user can check out.

    See my form here: https://form.myjotform.com/80471076679567

  • TREVON
    Replied on February 17, 2018 at 2:12 PM

    Its not possible to pass the value between the form without the form being submitted. However there is a work around I think may work.  

    I have created a main form which will have two form embedded to it. One form will have stripe Payment configured on it and the other will have PayPal form configured  in it. 

    I then create a radio element with allows user to select the payment method they want to pay in and then it will load the form where user will enter details of services they need and pay on the embedded form.

    Below is a sample form:

    https://www.jotform.com/80475891693976

    Below is a guide on how to create a form supporting multiple payments as illustrated above.

    https://www.jotform.com/help/182-How-to-Create-a-Basic-Multiple-Payment-Form

    Kindly feel free to clone and use the form.