What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How to create form calculation

    Asked by shinya ogasawara  on December 28, 2015 at 02:46 AM
    Thank you for your continued support.
     
    We would like to report a possible bug in form calculation and request your advice.
     
    One of our forms is set up so that a total amount due is calculated in a hidden field and shown in the final confirmation email. The form also has hidden fields that automatically calculate discounts for clients who order in bulk.
     
    All calculations had been running smoothly and displayed correctly on the confirmation email until we noticed that one client's total had been adjusted for bulk discounts that they were not entitled to. The calculated total was also affected.
     
    The problem did not occur before and we have been unable to replicate it since, so we assume that it was a one time glitch. Are you able to offer any advice as to why this would happen, and how it can be prevented if it is a known bug?
     
    Kind regards,
    Bug Report problem calculations hidden form calculation
  • Profile Image
    JotForm Support

    Answered by beril on December 28, 2015 at 06:29 AM

    Thank you for contacting us. I assume you mentioned about the form which is https://form.jotform.com/53149033070951.

    You need to specify a field name on condition.

    For example if you want to subtract 290 from Full table: 890 GBP, you need to indicate name of that value on condition as you see below:

    I hope it will work.

    If it doesn't your answer, please explain your concern with an example.

  • Profile Image

    Answered by shinya ogasawara  on December 28, 2015 at 07:51 PM
    Hi Beril,
     
    Thank you for your response. You are correct about which form we are referring to, although I fear you may have slightly missed the point of the question.
     
    Your proposed solution will only display the final amount after the discount is subtracted. We need to display the full amount of a stand order, the value of the discount and the final order total adjusted for discounts. This is why they are all calculated in hidden fields - all values are to be included in the order confirmation email.
     
    You will notice that both hidden discount fields have their values generated conditionally:
    -----
    IF [Spring Fair] TOKYO stand orders (a discount will be added for institutions that attend both Tokyo and Osaka) Is Not Equal To"Not attending"
    AND IF [Spring Fair] OSAKA stand orders (a discount will be added for institutions that attend both Tokyo and Osaka) Is Not Equal To"Not attending"
    Insert -290 into Discount for attending both Spring Fairs
     
    &&
     
    IF [Autumn Fair] TOKYO stand orders (a discount will be added for institutions that attend both Tokyo and Osaka) Is Not Equal To"Not attending"
    AND IF [Autumn Fair] OSAKA stand orders (a discount will be added for institutions that attend both Tokyo and Osaka) Is Not Equal To"Not attending"
    AND IF [Autumn Fair] TOKYO stand orders (a discount will be added for institutions that attend both Tokyo and Osaka) Is Not Equal To"Undecided"
    AND IF [Autumn Fair] OSAKA stand orders (a discount will be added for institutions that attend both Tokyo and Osaka) Is Not Equal To"Undecided"
    Insert -290 into Discount for attending both Autumn Fairs
    -----
     
    The problem is not calculating the discount - Jotform has been doing this perfectly since the form was made. The issue is that one order managed to be submitted as:
     
    [Spring] Tokyo Fair Full table: 890 GBP
    [Spring] Osaka Fair Full table: 890 GBP
    (Spring Discount) -290 GBP
    [Autumn] Tokyo Fair Undecided
    [Autumn] Osaka Fair Undecided
    (Autumn Discount) -290 GBP
     
    As you can see, despite the fact that conditions were not met for <INSERT -290 into Discount for attending both Autumn Fairs>, the discount was included on the final order and confirmation emails. Can you explain how this would happen, and how it can be prevented?
  • Profile Image
    JotForm Support

    Answered by beril on December 29, 2015 at 02:50 AM

    Thank you for your detailed response. The explanation was an example. I will check your form carefully and get back to you soon with a solution.

  • Profile Image
    JotForm Support

    Answered by beril on December 29, 2015 at 08:15 AM

    I carefully checked your conditions. If I understand your question correctly, If you choose Undecided or not attending it will not calculate discount.

    The calculation should be as you see below:

    [Spring] Tokyo Fair Full table: 890 GBP
    [Spring] Osaka Fair Full table: 890 GBP
    (Spring Discount) -290 GBP
    [Autumn] Tokyo Fair Undecided
    [Autumn] Osaka Fair Undecided
    (Autumn Discount) 0 GBP
     
    However, when I checked your submissions, I am not able to see same issue It is calculating properly.
    Here is your submission:
     
     
    890 + 890 - 290 = 1490
     
    We would appreciate it if you could send us the screenshot of submission.
  • Profile Image

    Answered by beo on January 03, 2016 at 11:57 PM

    Hi Beril,

    Thank you for the follow-up. You are correct about the calculation method, and as stated in the initial post we have also not been able to replicate the issue.

    Please see the attached composite screen capture for the submission in question.

    We will let you know if it occurs again.

    Many thanks

  • Profile Image
    JotForm Support

    Answered by ashwin_d on January 04, 2016 at 03:21 AM

    Hello beo,

    I did clone your form and tested it but I am unable to replicate the issue you are having. Have you embedded your form in any webpage where you had this issue? Please share the webpage URL and we will take a look and try to replicate the issue.

    We will wait for your response.

    Thank you!

  • Profile Image

    Answered by beo on January 04, 2016 at 07:03 AM
    Hi Ashwin,
     
    Thank you very much for looking into this.
     
    We have not embedded the form on any external website and the only link at which the form is accessible is:
     
     
    Thanks,
  • Profile Image
    JotForm Support

    Answered by beril on January 04, 2016 at 07:21 AM

    Thank you for screenshot and confirmation. If the problem occurs again, please let us know.

    At that time, we can assist properly.