Add select list to donation button?

evamoon
New Community Member

Hi all,

 

I'm creating a donation button for a nonprofit allowing people enter their own amount and that works just fine.

 

But we'd like to ask people to select a project to support (optional) from a short list. I can make the list, but I don't know how to get the data from the list. Here's my button code:

 

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="NWJG874NZ2YE4">
<select name="project" id="project">
<option value="0">Select project (optional)</option>
<option value="1">Project 1</option>
<option value="2">Project 2</option>
<option value="3">Project 3</option>
</select>
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

 

Thanks!

 

Eva

Login to Me Too
1 REPLY 1

snowshoe
Frequent Advisor
Frequent Advisor

What you have in mind can be easily done, the catch is the online button creator has it's limitations.  Unfortunally the online button creator does not have the options you need to create the code you have in mind.  Having said that, your donation item button code must be manaually created.

 

In order to provide you with a better idea of what can be done, check out the example below as it has the features you need and some extra ones:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title>Button Example Code</title>

<!-- START META TAG SECTION -->
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="Content-Language" content="en">
<!-- END META TAG SECTION -->



</head>

<body>

<!-- START SAMPLE CODE SECTION -->


<!-- PARAGRAPH 1 -->
Donation Examples

<br><br>

Using Options.

<br><br>

Widget Fund

<br><br>


<!-- Start of Form -->
<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- If using a Business or Company Logo Graphic, include the "cpp_header_image" variable. -->
<input type="hidden" name="cpp_header_image" value="https://yourwebsite.com/logo.jpg">
<input type="hidden" name="cmd" value="_donations">
<!-- Replace "business" value with your PayPal Email Address or your Merchant Account ID -->
<input type="hidden" name="business" value="your email address">
<input type="hidden" name="item_name">
<input type="hidden" name="item_number" value="WF-1001">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="currency_code" value="USD">
<!-- Replace value with the web page you want the customer to return to after a successful transaction -->
<input type="hidden" name="return" value="http://www.yourwebsite.com/ThankYou.html">
<!-- Replace value with the web page you want the customer to return to after item cancellation -->
<input type="hidden" name="cancel_return" value="http://www.yourwebsite.com/Cancel.html">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the seller:">
<!-- -->
Please enter your donation amount: (Example - 10.00)
<br><br>
<input type="text" name="amount" size="5">
<br><br>
Choose Your Organization:&nbsp;&nbsp;
<select name="item_name">
<option value="Widget Fund Donation - Good Will" selected>Good Will</option>
<option value="Widget Fund Donation - United Way">United Way</option>
<option value="Widget Fund Donation - Boys and Girls Club">Boys and Girls Club</option>
<option value="Widget Fund Donation - West Side Shelter">West Side Shelter</option>
<option value="Widget Fund Donation - Pets and Vets">Pets and Vets</option>
</select>
<br><br>
<input type="hidden" name="on0" value="In Memory Of">In Memory of - Enter Name:&nbsp;&nbsp;
<input type="text" name="os0">
<br><br>
<input type="hidden" name="on1" value="Tax Deductable Email Receipt Requested">Would you like a Tax Deductable Email Receipt?&nbsp;&nbsp;&nbsp;
<INPUT NAME="os1" type="radio" value="Yes" checked>Yes
&nbsp;&nbsp;&nbsp;
<INPUT NAME="os1" type="radio" value="No Thanks">No Thanks
<br><br>
<!-- -->
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<!-- End of Form -->



<!-- END BUTTON EXAMPLES -->



<!-- END SAMPLE CODE SECTION -->

<br><br>


<br><br><br><br>
<hr align="left" width="50%" noshade>
<br><br>
NOTES:
<br>
In order to test the code, you must replace the &quot;business&quot; value variable with your PayPal Email Address or your Merchant Account ID.


</body>
</html>

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.