There are times when you will want your clients to read and accept terms and conditions before making a payment in PayPal. The great thing about the following approach is that it will work for just about any website, whether the site is simply written in HTML or uses a CMS like WordPress, Joomla or Drupal.
Here is how to add a checkbox to your PayPal button.
STEP 2 -- Replace the following piece of code in the PayPal form created by the PayPal button generator:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return confSubmit();">
STEP 3 -- Insert the following code just before the line that starts with <input type="image" name="submit" …:
Option 3A -- Terms and Conditions on the Same page:
<p><input id="accept" type="checkbox"> I have read and agree to the Terms and Conditions</p>
Option 3B -- Terms and Conditions on a Different page:
If the Terms and Conditions are on a separate page, turn the text into a link. For example:
<p><input id="accept" type="checkbox"><a href="terms-and-conditions/" target="_blank">I have read and agree to the Terms and Conditions</a></p>
That's it. As a result of these changes, a new check box will appear right above the PayPal button. If the customer clicks the button without checking the box, the button will not work and a message will be displayed.
2012-11-27 at 9:03 PM
Thanks a lot for this! You rock!
2013-01-15 at 9:41 PM
I am trying to add the “terms and conditions” function to my site in which they have to accept before they make a paypal payment.
I have no idea in regards to coding, i just know how to enter the HTML onto my website and so far have the check box for terms nad conditions and the paypal button but i want to know if there is anyway in entering my actual terms and conditions into the html coding or there has to be a link to a seperate page.
Please advise, thank you.
2017-03-01 at 11:12 PM
I have the same question, did you got your answer ?
2017-03-02 at 1:09 PM
Hi Yaseen, though a little late, I just posted a reply to Anastasia’s question. Hope you find it useful.
2017-03-02 at 1:08 PM
You have several options:
Solution 1: The easiest is to create a separate page with the terms and conditions and then have the link take you there in a new tab or window.
Advantage: This centralizes the terms and conditions on your site. If you need to up date them, you need just make changes in one place.
Disadvantage: Some people might not realize that they are in a new window and not know how to get back.
Solution 2: You could simply include the terms and conditions text right in the page and remove the link from the text next to the checkbox. This is pretty easy to do as well. Another related solution is to use something called a “lightbox”. This would display the terms and conditions content in a popup box instead of taking up space on your page. This solution requires some coding in order to implement. You sometimes see these on websites where you click on an image and a larger version opens up but there is no reason it needs to be an image. Text can work well in these boxes too.
Advantage: This solution is especially useful if you only need to do this on one or two pages on your site and have a very short blurb describing the terms and conditions. Visitors to your site will be able to see the text without leaving the page.
Disadvantage: When you decide you need to update the terms and conditions in the future, you will need to find every page on your website where they exist and update them all. Having the terms and conditions right in your web page can also make your web page look cluttered.
One way around this last problem is to use a tag substitution system, also known as global content blocks. It goes by different names depending on the software that runs your website. For example, in WordPress they are called ShortCodes. On a WordPress site, you would start by installing a plugin like https://wordpress.org/plugins/reusable-text-blocks/ . Then you would create a new tag and enter your Terms and Conditions statement. Upon saving it, the plugin will give you a shortcode tag that will will look something like this: [text-blocks id=”1″]”. Then you need just copy and paste this into any page on your website where you would like the Terms and Conditions to appear. When people view the page, they will see the text associated with the shortcode instead of the tag itself. That way, if you ever need to update your terms and conditions, you will just need to go back to the reusable text block and edit the text. The content will be automatically updated throughout your website.
Hope you find something in all of this useful.
2013-12-03 at 12:28 PM
This worked splendidly! Thanks for the tip!
2013-12-05 at 3:51 AM
Thank you so much. Works wonderfully. Great easy to follow instructions
2014-02-13 at 7:19 AM
2014-03-21 at 8:27 AM
I’m having a problem with this solution when using two separate payment buttons on the same page.
Both correctly display the checkbox and “Please agree to the T&Cs”.
The button on the left works fine.
The button on the RIGHT requires the checkbox fof the LEFT button to be checked, before proceeding to Paypal.
Any idea how I might fix this?
Thanks a lot,
2016-03-17 at 1:37 AM
I am having this same issue, did you ever a solution? I have 4 buttons and the left most check box works but the 3 to the right do not. Thanks for any advice you may have.
2016-03-25 at 4:54 PM
Sorry Damien. Haven’t worked with it since. I am available if you want to hire me though! 🙂
2015-02-09 at 4:35 PM
Thank you, it has worked well. However, I noticed on an ipad that customers are not forced to check the box before purchasing. They have to check the checkbox on a desktop to be able to pruchase.
2015-05-01 at 7:47 PM
This worked great with one button, but when I try to use it for three paypal buttons on the same page, none of the buttons work. Do you have a workaround for this? Much appreciate the help!!
2015-05-03 at 2:36 PM
Thanks for the great question. Unfortunately the code was written to only work with one checkbox per page. It would have to be re-written to support multiple “Accept” checkboxes.
That said, I think it would still work if you put one checkbox in its own <form> for the whole page. The code only checks the checkbox and couldn’t care less where it is located. Something like (Step 3a version):
Hope that helps!
2015-05-04 at 12:53 AM
Thanks for the reply. That didn’t seem to resolve the issue. Any other thoughts? Again, much appreciate the help!
2015-05-11 at 6:26 PM
that’s exactly the code I was looking for, thank you so much! One problem, though, it seems to work only with Chrome. With IE and Firefox it doesn’t work. Do you have any idea why that is? I wonder if I’m the only one, who’s experiencing that kind of problem.
Thank you for your efforts!
2015-05-11 at 6:47 PM
it works! I don’t know why, but I’m happy it does! 🙂 Maybe it was the cache.
2015-07-08 at 5:12 PM
I’ve tried to add the Terms and Condition checkbox and the paypal button for the this website. The customers will need to check the box before proceeding to checkout, but it’s allowing me to proceed without checking the box. I can’t figure out where my code is wrong. Can you help, please?
2015-07-29 at 12:13 AM
There are many potential reasons why this might be happening and I could guess for a very long time at what the solution might be. Contact me if you would like to hire me to fix this up for you.
2015-07-29 at 11:41 AM
Thanks a lot, you save me a lot of time!
2015-08-27 at 5:31 PM
Such an elegant solution. Thank you!
2015-09-03 at 7:03 PM
You are very welcome Kathryn. I am grateful to hear it helped you out.
2015-12-11 at 10:49 PM
What an elegant solution! Thank you so much.
2016-02-07 at 4:56 PM
That would require some customization. Contact me through the Let me through the “Contact me” link above if you would like to hire me to fix it up for you.
2016-01-18 at 2:13 AM
Your html code is a godsend! Thank you! 😉
2018-03-29 at 6:21 PM
Hi, i’m certain I have included your code correctly on one page and the checkbox is there but i’m having the same problem as Rachel- rachel on July 8, 2015 at 5:12 pm.
What will you charge to help me fix this problem please?
2019-04-17 at 6:27 PM
I have added this to my site but people are still able to continue to PayPal without clicking the terms button. Can you tell me what I may have done wrong?
Click on Waban village day and then family fun run registration and you will see the terms checkbox and how you can bypass it.
2019-11-06 at 1:00 PM
Hi Jennifer, hope the fix I provided helped contribute to the success of your event.
2019-12-28 at 11:08 AM
Hello, I have a question in regards to HTML code for the paypal button. I have an online medical clinic that the hours of operation are say 9am-7pm mon-sat is there a way to disable the paypal button for times outside the hours of operation? Thanks all help is appreciated.
2020-01-03 at 10:45 PM
Here is a link to a snippet of code demonstrating how to enable and disable a button during certain hours of the day:
Naturally you would replace the ‘checktime’ in getElementById(‘checktime’) to the id of your paypal button.
Instead of disabling the button, another approach to this might be to have a message pop-up if they try to click it outside of normal business hours. The message would let them know that this is only available during normal office hours. Even better might be to remove the button during certain hours and display a message instead.
Need help coding it to your specific requirements? My services are available by sending me a message through the form at https://www.tngconsulting.ca/contact/
Hope you find this helpful.
2020-07-14 at 7:58 PM
Thank you for this. Worked like a charm. Super easy to follow!
2021-01-31 at 12:39 PM
Great bit of code AND instructions – Thanks for sharing your knowledge!