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

    Conditional calculations (postal and centre dropdowns multiplied by number of selected modules)

    Asked by CecilevdM on November 26, 2013 at 04:53 AM

    Hi. 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

    Page URL:
    http://form.jotform.co/form/33224317129852

    calculations checkbox responses thanks
  • Profile Image
    JotForm Support

    Answered by EltonCris on November 26, 2013 at 07:15 AM

    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!

  • Profile Image

    Answered by CecilevdM on November 26, 2013 at 01:54 PM

    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!

  • Profile Image
    JotForm Support

    Answered by EltonCris on November 26, 2013 at 04:09 PM

    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!

  • Profile Image

    Answered by CecilevdM on November 27, 2013 at 05:29 AM

    Thank you so much!

  • Profile Image
    JotForm Support

    Answered by EltonCris on November 30, 2013 at 04:40 AM

    @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!

  • Profile Image

    Answered by CecilevdM on December 01, 2013 at 12:21 PM

    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!!

  • Profile Image
    JotForm Support

    Answered by jonathan on December 01, 2013 at 05:09 PM

    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 Adding-Form-to-Google-Sites

    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.