JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
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.
Adding to a field with a value.Asked by oparada1120 on September 19, 2016 at 11:42 PM
Hope all is well! Here what I'm trying to achieve...
I'm putting together an order form with a Total field at the end. An order is placed with an item and quantity and the Total field is populated with the total amount. Now I have the option to add an additional order and when the user selects an additional item and adds the quantity I want to be able to add onto the value that's already in the Total field with the additional value from the extra item that is being added. I can't seem to get the math right.
Please let me know if this makes any sense and thank you in advance!
I believe we can achieve your requirement by replacing your current Total textbox field with a Form Calculation Widget instead. Please follow the steps below:
1. Add the form calculation widget to your form.
2. Now add all the Meal dropdown and Quantity fields required for calculating the Total price. Here's a guide on How to Perform Calculation in the Form? The final formula should look something like the one below:
3. It looks like you have already added calculation values for the first and second dropdown fields, however, the third and fourth do not. So we will now need to add calculation values to the 3rd and 4th dropdown. Click the gear icon of the Select Your Meal dropdown then add the Calculation values on the Survey tab.
4. Once you have added the calculation values to the third and fourth dropdown, you're all set. You just need to delete the Update/Calculation conditions since we already have a calculation formula so will no longer need that.
If you need further assistance, please let us know.
Thank you so much and I apologize for the massive delay in getting back to you. Your recommendation seems to have done the trick here but now I’m noticing another little issue. Whenever the amount ends in a ‘0’ it doesn’t display properly. So instead of the total amount displaying as “42.10” it displays as “42.1”.
Any way to get around that? I’ve check some settings and can’t seem to find any that could help me out.
Many, many thanks!
In the calculation configuration, make sure to check show empty decimal and make sure to select 2 from the dropdown:
Here's a test form showing the empty decimal: https://form.jotform.com/63055701662957.
Looks like that did it! I had accessed those options earlier but did not check Show empty decimal places.
Many, many thanks!!