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.
Calculation text fields with total to PaypalAsked 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.
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:
For local testing you can try:
I am not much a JS expert, but I will try to check/debug code later today, and then get back to you.
That would be great, thank you so much!
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
You are welcome.
There is a link to the corrected script, I have only corrected IDs and removed unused fields.
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).