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.
Complicated Form Idea With Adding Calculation Problem. - RESOLVEDAsked by AA_C on November 26, 2016 at 04:06 PM
I may be going about this form problem in a way that is not the best. (63295133118958)
I'm attempting to use "TEXT" option and edit the html to suite my needs.
I create required fields then copy that field code into the TEXT html
So far I have been successful but now I have a problem doing a simple calculation.
The Qty Column has two inputs, one for M and one for W.
I want to add the input values in these fields and then multiply by the unit cost.
I'm using the calculator but I'm not getting a value in the total that makes any sense.
Also it should show two decimal places.
Perhaps you could offer a different method for creating this form.
Here is an image of what I'm looking for.
I see that you are using table. In order for your calculation to work, you must add the calculatedOperand class and the field ID on the td tag where the source fields are.
Example for the Q quantity field: The highlighted parts are the most crucial parts in order to get the calculation to work.
Hope this helps!
Yes this is very helpful indeed. I cloned your form and it is working. Now I will attempt to add all the required inputs and calculations. I Assume I need a separate hidden calculation functions for each field that requires a calculation.
Note: The bottom of the form below the table I used as a sketch pad for creating my inputs, then copying the id's to the table, Question, after I have all my inputs identified and working in the table can I safely delete the bottom inputs etc. ? I will keep all the hidden calculation fields.
I hope I'm clear, I have a tendency to ramble on.
I must be close with my calculations but it is acting very strangely.
1. ERROR1 If a value of 1 QTY is entered for either M or W of the first item the total populates all my total fields.
2. If I don't enter any value for item 1 my fields appear to function almost correctly.
3. ERROR2 If I enter a QTY in both boxes of item 2 only the M value is calculated.
4. Items 3 to 5 all appear to function correctly.
I'm at a loss as to my errors???? Please Help
I deleted all the fields below the table. The table calculations are still not working as they should.
I added new fields below the table to test calculations. As in the table the first Quantity inputs are creating values in all 5 total. This only occurs with the first row, the other rows all respond as they should as dose the subtotal and tax calculation...... What am I missing here for the first calculation that it interferes with all the rest?
I'm on a bit of tight schedule here so that is why I keep posting questions.
Many thanks JF,
I'm still checking the form, although I do not recommend this kind of setup as it might easily break.
I'll get back to you the soonest.
I tend to agree... It gets messy... Thanks... Perhaps I should rethink the process.
See if my form works as you expected: https://form.jotform.com/63313718050953. You can clone it to see how I set it up.
What I did:
1. I used text boxes and conditional logic for the sub totals.
2. I removed the "calculateOperand" because it is added as a class, which means it is applied to all elements that has that class name, in your case all sub totals will have the same value.
I hope that helps. Although I still don't recommend this personally for the following reasons:
1. It is hard to maintain or make changes because we're dealing on referencing form fields to your raw HTML fields.
2. There's a chance that a slight update may break the referencing (but this is quite unlikely unless you are referencing a widget). I'm using simple text boxes for the totals so it is highly unlike that the unique name or field IDs will change because of an update.
I hope that helps.
Thanks a bunch Charlie... Works now...
Can I delete all the fields below the table? SORRY I see how you are calculating and need them, I will hid these
That's great to know.
You can delete the fields if they are not in used. If they are, you can just hide them.
Please contact us again if we can help in any way.
OK... Getting there ... How do I get the values to show two decimal places?
To get the value to show 2 decimal places, simply open your conditions wizard for the specified field and follow the steps below.
1. Click the ... button to show the additional options
2. Then select the Options tab and check the "Show empty decimal places" checkbox.
Do this for all the conditions and it should now show two decimal places.
If you need further assistance, please let us know.
Thanks, that worked, helps with French prices also, nice fix.
So far so good... Marching on.... But!
If I have conditions on one page and try to use them on another, should they work?
I created two pages for this form, Page 1 had all the conditions and the form, Page 2 had the same form only in French but no conditions. It wouldn't work.
I had tried using radio buttons to select Page 1 or Page 2, Selecting page 1 worked Page 2 failed.
How would I get the conditions to work on both forms?
Form with ID 63295133118958 that you provided on this thread has only one page. Are you working on some other form? If so, please provide us ID of that form.
I'm not sure how your conditions were set, but they should work on another page as well.
I also think that you should open new thread, because it seems that your issue with conditions is not related to subject of this thread. This way we can avoid confusion.
Sorry, I had tried this on an earlier version, and later deleted it so my question was rhetorical. You have answered my question and I appreciate the feedback. I was thinking any issue with this form was related, again sorry.
No worries, Robert. :)
Since this thread was about calculation issue on text HTML field, I have moved your conditions question to a separate thread here https://www.jotform.com/answers/1000604. We'll be on this thread shortly.