How to create PayPal button with custom fields

You can easily create a custom PayPal button or donation button with custom user input fields using just HTML. In this example we will make a donation button.

PayPal Button Instructions Page

First lets look at a basic HTML markup for a PayPal button:

paypal_button_html

Next we will modify this markup for our own use.

Change ‘cmd’ field:
Right now the ‘cmd’ field value variable is set to ‘_cart’, which defines our button as an ‘add to cart’ button. Change the ‘cmd’ variable to ‘_donations’.

Change the ‘business’ field:
Replace the ‘business’ field value with your PayPal account email address.

Change the ‘item_name’ field:
Change the item name field value to ‘my website donation’.

Change the ‘amount’ field:
Now let’s change the ‘amount’ field so that the person donating can specify the donation amount, a label and make the field required.

paypal_form_donation_amount

Specify return page:
Lets add a return variable that specifies the thank you page we want the user to return to after making the donation. Replace the google url with your own.

paypal_donate_return_page

Add a custom field radio button:
Let’s create a custom radio button field where the person donating gets to opt in to receive a free coupon.

paypal_custom_donation_field

Add a note field:
This field lets the user add a note to his donation.

paypal_custom_note_field

Change ‘image’ field:
Right now the button for our form would appear as a ‘Buy’ button, let’s change it to a ‘Donation’ button. Change the ‘btn_buynow_LG’ text in the ‘src’ field variable to ‘btn_donate_LG’.

You’re done!
You can add more custom input fields this way. For a list of more PayPal variables to modify go here.

Advertisements

Published by

angelo bonavera

Hi I'm a web developer and I run a web hosting company called 2slick.com.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s