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

    How to copy calculation result to Paypal Donation field?

    Asked by kimkat2013 on March 24, 2014 at 09:34 PM

    I need to create a form that allows people to register for different things at the event for different costs, collect info about person and total the cost. I need to be able to allow each person to make a donation and add it in and then at the end deduct an amount they have already pre-paid, either $50 or $100.

    Can I do that with JotForm? Can you point me in the right direction?

     

    Thanks!!!

     

    Kim

    create a form create JotForm donation different
  • Profile Image

    Answered by Cesar on March 24, 2014 at 10:19 PM

    To assist you better it would be good to know if you are going to be using an online payment service provider or if the money transaction will take place on site. 

    Calculation fields may be able to suffice your current needs if no online payment process will be used, please make sure to review the following guide on Calculation fields.

    Do let us know if you need any other assistance once you have started composing your form. 

    Thank you.

     

    Related Article:

    How-to-perform-calculation-in-the-form

  • Profile Image

    Answered by kimkat2013 on March 24, 2014 at 10:50 PM
    Aloha Cesar,
    Thanks for your reply!
    We need to send everyone to Paypal eventually, but it would be great to do all the math in the form!
    Is that possible?
    Thanks again!
    Kim
    ...
  • Profile Image
    JotForm Support

    Answered by ashwin_d on March 25, 2014 at 12:24 AM

    Hello Kim,

    As my colleague have mentioned above that you can take advantage of our "Form Calculation" widget to do all the calculations. But currently, we do not have feature where you can pass on the calculated value to PayPal payment question.

    Even if you use "Collect Donations/Custom Amount Payments" in your paypal question, the challenge will be to copy the amount from the "Form Calculation" widget to the "Custom Amount" field. To achieve your requirement, you will have to download your form's source code and add custom JavaScript code to send the calculated value to the custom amount field of your payment question.

    Do you want to take the forms source code route? Please be noted that if you embed your form with its source code, any changes made to your form will require the source code to be downloaded and add the custom JavaScript code again.

    If yes, please go ahead and build your form and we will provide you with the custom Javascript.

    Thank you!

  • Profile Image

    Answered by kimkat2013 on March 25, 2014 at 03:30 AM
    Sounds like it is worth a try!
    Thank you for your help.
    Kim
    ...
  • Profile Image

    Answered by kimkat2013 on March 25, 2014 at 04:20 PM
    Okay!
    I have given this a shot.
    I have created a form with your calculation wizard that creates all the necessary information.
    Is it possible to send this amount to Paypal with your Java Script workaround?
    this is my form:
    http://www.jotform.com//?formID=40724088728158
    Let me know how to move forward!
    thanks!
    Kim
    ...
  • Profile Image
    JotForm Support

    Answered by Welvin on March 25, 2014 at 06:52 PM

    Hi Kim,

    You have to add the Paypal Integration to the form and use the donation type before this can be done to the form source codes. Anyway, we'll come back to you for the workaround.

    Thanks

  • Profile Image
    JotForm Support

    Answered by Welvin on March 25, 2014 at 08:43 PM

    Update:

    Here's the modified form source codes: https://shots.jotform.com/welvin/pages/copy-calc-total-to-paypal-donation.html with added scripts on it to copy calculation total to the Paypal Donation page.

    Steps:

    1. Edit your form and add the Paypal Donation field.

    2. Hide the calculation total from the form by using the "Hide" field function from the field properties, this just serve as our based field for the Paypal donation:

     

    3. Get your form source codes: How to Get Form Source Codes and save it as an HTML file. You will have to host this HTML file to your own server because there's no way you can import the modified source codes to our form builder.

    4. Add the following script to the source codes: http://pastiebin.com/53321e8a9ddd4. Add this to the bottom, after the end </script> tag:

    ...you'll notice the ID: input_93_donation. This is different from your Paypal Donation input field ID so you have to change this. You can find the ID of the field by following this guide: How to Find Field IDs & Names.

     

    5. You have to add this event script to the calculation total: http://pastiebin.com/533220f79d2e5, add this to the input properties of the Calculation Total field:

     

    6. That's it! Save the changes and upload it to your server.

     

    If you have troubles implementing this workaround, let me know. Just please proceed on adding the Paypal Donation and let us know the form URL.

     

    Thanks

  • Profile Image

    Answered by kimkat2013 on March 26, 2014 at 03:30 AM
    Okay...I got some of this....but not working.
    1) Turned on the Paypal Donation, entering account and selecting "Collect Donations/ Custom Amount" and checking the "this is a donation" checkbox.
    2) Hid Total amount Field
    3) Generated and embedded code in hosted page:
    http://na-hawaii.org/registrationplaceholder.htm
    4) Entered extra script, but when I look for the field with the correct id, the "Properties" panel doesn't display it.
    Also noticed that occasionally the mandatory "name" field stays red even when data is entered. Any thoughts on this?
    Thanks for your help!!
    Kim
    ...
  • Profile Image
    JotForm Support

    Answered by ashwin_d on March 26, 2014 at 06:56 AM

    Hello kimkat2013,

    Upon checking your web page, I did not find that you have used your form's source code. Have you removed it already?

    You need to add cusotm JavaScript code as suggested by my colleague and then use it to embed your form in your web page. I did check your form and the id of your PayPal donation field is "input_93_donation". Please try this and get back to you us if you have any issue. It would be great if you embed your form with source code so that we can take a look and resolve the issue.

     

    Also noticed that occasionally the mandatory "name" field stays red even when data is entered. Any thoughts on this?

    The issue could be related to code conflict between your form script and other scripts of your form. The solution to this problem is to embed your form in an iFrame. Here are the steps to embed your form in iFrame while using your form's source code:

    1. Download your form's source code and add the custom Javascript code as suggested by my colleague.

    2. Upload this html file in your own server and grab the html file URL.

    3. Paste the following iFrame code in your webpage where you want to display your form:

    <iframe id="JotFormIFrame" onload="window.parent.scrollTo(0,0)" allowtransparency="true" src="XXXXX" frameborder="0" style="width:100%; height:100%; border:none;" scrolling="no"></iframe>

    4. Replace the "XXXXX" in the above iFrame code with the html file URL you saved in step number 2 above.

    This will ensure that there is no code conflict and your form should work as expected.

     

    Thank you!

  • Profile Image

    Answered by kimkat2013 on March 30, 2014 at 03:10 AM
    Hi there,
    The source code is in there.
    The link is:
    http://na-hawaii.org/registrationplaceholder.htm.
    If you look in the source code after the navigation (last item is the contribution portal) you will find the script embedded as you suggested. The field is also 93.
    I am attaching a screen capture of the Dreamweaver code.
    Please let me know how to move forward with this.
    Thanks!
    Kim
    ...
  • Profile Image

    Answered by Cesar on March 30, 2014 at 01:57 PM

    Please verify the address provided, as I am unable to access the page with the embedded source code. Just to verify this would be a page with the source code modified by our colleage Welvin? Do let us know. 

    https://shots.jotform.com/cesar/screens/verifyaddress01.jpg

    Thank you.

  • Profile Image

    Answered by kimkat2013 on March 30, 2014 at 02:50 PM
    Looks to me like you have a period at the end of the url, try removing it.
    ...
  • Profile Image
    JotForm Support

    Answered by jonathan on March 30, 2014 at 08:19 PM

    Hi,

    Checking this URL http://na-hawaii.org/registrationplaceholder.htm I can only see a script embedded form.

    It is not using the form's source code

     

     

    Please confirm if this is the correct URL where we can check the source code embedded form.

    Thanks.

  • Profile Image

    Answered by kimkat2013 on March 30, 2014 at 10:20 PM
    Okay!
    I have now embedded the form in the web page, and it will submit the form, and automated responses are generated, but nothing totals or goes to Paypal.
    I think we are getting closer!
    http://na-hawaii.org/registrationplaceholder.htm
    ...
  • Profile Image
    JotForm Support

    Answered by TitusN on March 31, 2014 at 07:09 AM

    Hello,

    Its going to be hard to explain what is wrong with the page, but I will list the errors:

    1. The sync function is not declared in the hidden total calculation texbox

    2. The function is not placed within its correct html tags

    3. There are some errors at the top of the page that might break the HTML structure -

    If you were trying to add comments to a HTML page - thats not the way to do it, try this way instead.

    I have fixed it all for you - but I need you to place the fixed source code on your site so that we can pick out what I missed:

    So,

    Please do the following:

    Delete all the code found on this page - http://na-hawaii.org/registrationplaceholder.htm

    Replace it with the source code shared on this pastebin: http://pastebin.com/r9gUj1Wq

    To select the source code - do as shown below, then press Ctrl+C

    Let us know when this is complete, we shall check and advice.

    Thanks.

  • Profile Image

    Answered by kimkat2013 on March 31, 2014 at 11:20 AM
    Aloha Titus,
    I have loaded your code and it looks like it works beautfiully!! It totals properly and submits to Paypal.
    The only thing that seems to be missing now is a notification of the form being being submitted. I don't see it in my JotForm panel, and I don't get any notifications of submission. Somehow it is not linked to the magic that happened in the form.
    Thank you so much for helping us make this work!
    Kim
    http://na-hawaii.org/registrationplaceholder.htm
    ...
  • Profile Image
    JotForm Support

    Answered by TitusN on March 31, 2014 at 11:25 AM

    The notification will not come through until the payment is completed on paypal. Its a default setting that gives you the assurance that a donation has been submitted  . .

    This is because people often change their minds when making payments - or sometimes their accounts do not have money at the time - among many reasons

    But you can still view the submissions that were sent without payments completed in paypal..

    To view the submissions - you need to open the Incomplete Payments as shown here.

  • Profile Image

    Answered by kimkat2013 on March 31, 2014 at 11:40 AM
    Fantastic!
    Thank you so much for your support and help with this!!!
    Kim
    ...
  • Profile Image

    Answered by digiosolutions on May 15, 2014 at 09:09 AM

    wow, good to know there is a workaround. But honestly, you guys now totally need to think about this as a feature request. those calculation fields could suddenly be a lot more cash-worthy with imminent checkout and payment through service providers for those of us who are limited to that option, which i would bet is majority of jotform users. good value added for functionality of jotform for business. if you checkout the latest form i am building, u will see why... if i had this functionality without having to resort to source code to allow for easy form and price updates, i would even be able to duplicate the form and use it for regular take out and online orders as well... right now we have to pay another company a good amount of money each month to do just that regular online ordering, but since catering did not require immediate payment, we can do it with jotform at much lower cost... just trying to point out, you could make more money with that feature too...

     

    Thanks

  • Profile Image
    JotForm Support

    Answered by TitusN on May 15, 2014 at 09:26 AM

    The feature has been implemented:

    Try it out and let us know.

  • Profile Image

    Answered by milbra on May 28, 2014 at 09:02 PM

    TitusN,

    I don't see the same options as shown on your screen shot. Mine missing the dropdown.
    What am I missing?

     

    FYI...

    I found out why I couldn't see the dropdown earlier. My calculation was done within a text field. As soon as I used the calculation widget for the calculations, it appears.

    Hope this helps others.

  • Profile Image
    JotForm Support

    Answered by TitusN on May 29, 2014 at 01:00 AM

    Great to hear that - and yes - that information will definately help others. 

    We've created a guide for that as well - found here