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

    Calculation text fields with total to Paypal

    Asked by AwakeningConference on November 07, 2013 at 02:48 PM

    Hi, I'm trying to create a script that can add together user inputted text fields (numbers) and calculate the total and display it in a text box then when the form is submitted go to Paypal with that number.  I've included my form and the code I've come up with so far.  I don't think I've written the script correctly. It is my first attempt at trying to teach myself!   Could you help me come up with a solution for this? Thanks so much.

     

    http://form.jotform.co/form/33104455951855

    http://pastie.org/8463546

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

    JotForm create thanks solution
  • Profile Image
    JotForm Support

    Answered by Mike_T on November 07, 2013 at 03:28 PM

    Thank you for contacting us.

    As far as I understand, you are trying to do the calculations with jQuery, so you will also need to include the library:

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

    For local testing you can try:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

    I am not much a JS expert, but I will try to check/debug code later today, and then get back to you.

  • Profile Image

    Answered by AwakeningConference on November 07, 2013 at 04:28 PM

    That would be great, thank you so much!

  • Profile Image

    Answered by AwakeningConference on November 07, 2013 at 05:44 PM

    I feel like my code should be working because I replicated a similar code from another Jotform.   But I can't seem to figure out the problem. If I could get that working then all that would be left is finding out if it's possible to send that number to be paid for in Paypal.

     

    This is the form I had the script from that I saw in another thread https://shots.jotform.com/elton/jotform_calculate_225033.html

  • Profile Image
    JotForm Support

    Answered by Mike_T on November 07, 2013 at 06:51 PM

    You are welcome.

    There is a link to the corrected script, I have only corrected IDs and removed unused fields.

    http://pastebin.com/VPW3bXxb

    You can add the script after the form closing tag </form>. Also, you do not need to include the jQuery library, the script is based on Prototype JS instead (and that library is already included to the form).