How to calculate a total value based on user input?

  • MGGKC
    Asked on April 22, 2016 at 5:55 PM

    How to construct an IF/THEN/ELSE condition involving the total cost of a ticket (discount to be applied with a specified ('MGDiscount') password).

     

    I've included a screenshot of the area of the form that I'm trying to do the above calculation.

     

    Thanks!  Karen

    Jotform Thread 824772 Screenshot
  • Kevin Support Team Lead
    Replied on April 22, 2016 at 7:34 PM

    First off, I would suggest you to remove  the word password from your fields, though you are not asking for password in your form it may be cataloged as phishing and it will be disabled and your account suspended, JotForm does not allow to ask for sensitive data and if our anti-phishing system detects that you have these words on your form then it will proceed and suspend your account, read more about what you are allowed to ask in our terms

    Now regarding to your question, this is possible to achieve using conditions, you will need to use the "Update/Calculate Field" condition to do that. 

    How to calculate a total value based on user input?  Image 1 Screenshot 60

    I also would  suggest you to use a text box field to insert the result of  the calculation and if you need to add other fixed values you may use our Form Calculation widget. 

    How to calculate a total value based on user input?  Image 2 Screenshot 71

    How to calculate a total value based on user input?  Image 3 Screenshot 82

    Once the form calculation widget is added to your form you will get a window where you will add your calculations, in case that you use the value calculated with conditions with other calculations, and it should look like this: 

    How to calculate a total value based on user input?  Image 4 Screenshot 93

    The condition will be based on other field input or selection, in my example, this will be based on a selection of a radio button and your condition should look like this, making your operations and adding the result in the text box. 

    How to calculate a total value based on user input?  Image 5 Screenshot 104

    Here is  the link to my sample form: https://form.jotform.com/61126424117951.

    Feel free to clone it.  

    Do let us know if you have questions when trying to apply this to your form, we will be glad to help you.