What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No signup 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.

Conditional calculations (postal and centre dropdowns multiplied by number of selected modules)
Asked by CecilevdM on November 26, 2013 at 04:53 AMHi. I want to add calculations to my form that calculates the total amount that needs to be paid. Payment is always via EFT so just want to give them the total. It is for students registering, so there is a checkbox area where they choose which subjects to register for. The calculations will be conditional on previous responses (what country they live in). If for example they live in Africa, then it will be the total number of subjects chosen multiplied by 1725. If they live outside of Africa, it is the total number of subjects chosen multiplied by 2220. I don't know how Java Script works at all so can't do it in there. Is there any other way to get this done? Thanks
http://form.jotform.co/form/33224317129852
calculations checkbox responses thanks 
JotForm Support
Hi there,
We can help you with the custom script. Since this will be a custom workaround, you will be using your form source code when embedding. How to get your Form Source Code
I have checked your form here, and I am a little confused on which fields will be used for calculations.
Let says for example:
Country of Exam Centre field for the country condition.
Total due: field will be for total
I'm not quite sure what field to get the number of subjects. If you could also explain a bit further on the calculation formula, that would be a big help before we can create a sample script for your form.
Thank you!

Hi,
They choose their subjects in the tick boxes where it says "Tick the modules for which you want to register in the first semester of 2014". They can choose any amount there, so the number of boxes they check is the number of subjects they will register for. The cost of all modules are the same depending on where you live. "Country of Postal Address" and "Country of Exam Centre" will be used for calculating the cost of each subject. Here are the calculations for each of the possible scenarios:
Country of Postal Code Country of Exam Centre Cost of subject
Outside of Africa Any of the options R2220
Rest of Africa Outside of Africa R2220
Rest of Africa Any option except "Outside of Africa" R1735
South Africa Outside of Africa R2220
South Africa Rest of Africa R1735
South Africa South Africa or Prisons R1250
The total cost will then be the number of subjects chosen multiplied by the cost per module as calculated above.
Thanks so much for the help!

JotForm Support
Hi there,
Thanks for explaining it further, that's greatly appreciated. We will try to come up with a workaround in a day or two and provide you the script need for this calculation. If any questions arises, I will let you know here. This may take some time since we have to do this on our free time.
Thank you!

Thank you so much!

JotForm Support
@Cecile
Apologies for the delay.
Here's the script you need for the form calculation. http://pastebin.com/raw.php?i=VvC0dN2e
Just take your form source code (copy the provided script) and append the calculation script. Save your form as html file or you can embed the entire source code directly on your page.
Hope this helps. Let us know if you have further questions or if you need further assistance. Thank you!

Hi. How exactly do I edit and save the form source code? We just want to give students the jotform link and let them do the submission here. Preferrably we don't want to put it in our own website. Is this possible? Just while trying to get it right, I created a google sites website to see if I can get it right there, but still could not manage. So if this is not possible, can you explain to me how to do it in google sites? Sorry for all the questions, I've never really done any of this before.
Thank you so much for all the help!!

JotForm Support
Hi,
What you needed do requires the form's source code to be used and embedded on your own website. This the reason for our collegues suggested solution.
But since you already mentioned now that you do not prefer it hosted on your own website, then uisng the form's source code is not the primary solution.
Here is the guide on how to AddingFormtoGoogleSites
Just to clarify, you can still use the form's source code when embedding the form, BUT you cannot inject the javascript code suggested by our colleauge since it will not be allowed on the Google website.
Thanks.
