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.
Calculations inside of my form are not working correctlyAsked by azstruhar on July 01, 2015 at 08:25 PM
Working on '3 Student Registration Template.' It is showing fields it shouldn't be showing. It is failing to perform basic calculations no matter how I configure it. It acts as if maybe check boxes are pre-checked before the form loads, although I know that isn't the case.
Here, 2 Elective Weekday, Time, Instructor Preference appears on form load. It should not appear until called for by a rule.
The form start exhibiting strange behavior, including the inability to perform simple calculations. I'm stumped.
For example, if here I check and uncheck "Student 2" the line that should be hidden goes away.
I have inspected your form and it seems that "Registration Fee" field is causing wrong calculation. I would suggest you to add new field "Registration Fee" and hide old field and add conditions to your new field.
I have also removed $ sign inside of calculation fields inside of my cloned form.
Also when I inspected your form "2 Elective Weekday, Time, Instructor Preference" was not shown, it was hidden by condition.
Here is my cloned form where I added new Registration Fee field.
Feel free to clone my form if you want to take closer look to my conditions.
Hope this will help. Let us know if you need further assistance.
I had to completely change the way these elements were hidden/shown because it was not working properly. Originally, I had a condition to show them if an elective were selected. It was working fine this way but suddenly stopped working. I then had to explicitly hide them until an elective was selected. This seems to be working for now.
The registration fee field needs to be $15 if only one student is registering, $30 otherwise. I've tried several different approaches to this, they all seem kluldgy.
Thanks for your help.
I've made a number of changes. I still can't see why my new 'subtotal' 'sales tax' 'grand total' fields don't calculate properly. I think if I understood the logic behind how/when/why these fields update I could find a workaround.
If I understand correctly what you are trying to calculate in the Subtotal field, then please tick the option in the Calculation to Ignore Hidden fields.
Otherwise, fields such as the Family Discount are being included in the calculation, even though the fields are hidden.
This is how the calculation looks for me after that single change:
I hope this helps. Please let us know if you need further assistance.
I made this suggested change. When I make the same '1 Course Selection' (I assume you chose 'Petite Dance' as tuition was $42) I get 57 in Subtotal, 1.05 in Sales Tax, 16.05 Grand Total. These totals are incorrect.
Also, Student 2 Total and Student 3 total shouldn't appear unless the 'Add Student 2' or 'Add Student 3' are selected.
The form is behaving differently for you than for me. I have cleared the form cache more than once, and the browser cache, and tried a different browser.
Yes, I have clicked on the Student 2 and Student 3 just to show if they are being calculated, that is why they were shown in the image. I have used the Petite Dance, that is correct.
When it comes to the calculation of the tax and grand total, I can see that the calculation doesn't always update as you change your options. The 1.05 in the tax field is exactly 7% of the registration fee (15), which suggests that your Sales tax is being calculated before the Subtotal field.
This is happening because you have both a Condition and a Calculation "fighting" each other on which one is going to update your Subtotal field. Please try disabling the condition for the Subtotal field, and see if this helps.
Removed the condition. Still only getting 7% of 15.
I have tested your form, and no matter which option I choose for the Course Selection, all the fields are calculating properly on my end.
The only time that it doesn't is when there was something selected in the Course Selection, and then cleared - the calculations remain from the Registration Fee that is conditionally removed. This is a cosmetic issue, as your users can't submit the form anyway with the required Course Selection being empty, but to remedy this you can add a Condition to set Registration Fee to zero when none of the Course Selection fields are filled.
If you are still getting incorrect calculations, please do let us know the exact steps it takes to encounter the issue. Such as are you opening the form in a new tab, or refreshing the page? What fields do you select / deselect to have the calculation misbehaving?
Open form. Select 1 Course: Predance. Check 'Tumble Tots.'
Form calculates correctly so far.
Now Select 2 Course: Predance.
Tuiton Total = 79 which is correct,
Family Discount shows -8.9 which is incorrect.
I do apologize that you are still experiencing an issue with your calculations. I was able to replicate the issue that you have described:
I made a change to your calculation, and your discount field now works as expected.
As you have already calculated the total in tuition total, the new calculation has that total being multiplied by .1
You can view my cloned form here: http://form.jotformpro.com/form/51826563358968
I hope this helps, please inform us if you need further assistance.
(Private)Answered by azstruhar on July 13, 2015 at 06:27 PM
The solution here was to not allow fields to rely on other fields for input. I had to create conditional calculations for each field independently.
Also, as I was trying to make the form failsafe, I evidently overwhelmed the form's ability to manage conditions and calculations, as all kinds of errant data was appearing in random fields. The solution was to streamline the conditions to cut down on the sheer number of them.
So far, the revised version of this draft form is working very well at
Thanks for sharing to us the solution/workaround you have created to fix the issue. If you encounter any problems again, do let us know so we can further assist you.