Customize Button with checkboxes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am selling three services, One for April, May and June.
I would like the user to have the option of buying 1,2 or 3 of them. There does not seem to be a way of doing this easily with Paypal and a single login.
Ideally, I would have a single form, and three check boxes. Users would check off the month(s) they want, and fill out the form only once. What is the best way of doing this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you have in mind cannot be done using the online button creator as it does not have the capability for creating check boxes or radio buttons. You can do exactly what you want by manually coding your item button and using a custom script to manage the logic or choices and then send the results to PayPal. Depending on the design and needed the fuctions, the script could be basic or complicated. For coding and/or script ideas, check out this link:
http://ccaples.com/index.php/basic-scripts
Below is a script example that uses the "upload" method. As there are multiple ways of scrpting, this but one method. The example is a complete web page. To tinker with it, replace the "business" variable value with your PayPal email address.
<!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 --> <!-- Start of Script --> <SCRIPT LANGUAGE="JavaScript"><!-- var count=1; function codename() { count=1; document.formname.item_name_1.value=''; document.formname.item_name_2.value=''; document.formname.item_name_3.value=''; document.formname.item_name_4.value=''; document.formname.amount_1.value=''; document.formname.amount_2.value=''; document.formname.amount_3.value=''; document.formname.amount_4.value=''; if(document.formname.item1.checked) { document.formname.item_name_1.value = "Item 1"; document.formname.amount_1.value = "2.00"; count=count+1; } if(document.formname.item2.checked) { if(count==2){ document.formname.item_name_2.value = "Item 2"; document.formname.amount_2.value = "5.00"; count=count+1; } if(count==1){ document.formname.item_name_1.value = "Item 2"; document.formname.amount_1.value = "5.00"; count=count+1; } } if(document.formname.item3.checked) { if(count==3){ document.formname.item_name_3.value = "Item 3"; document.formname.amount_3.value = "9.00"; count=count+1; } if(count==2){ document.formname.item_name_2.value = "Item 3"; document.formname.amount_2.value = "9.00"; count=count+1; } if(count==1){ document.formname.item_name_1.value = "Item 3"; document.formname.amount_1.value = "9.00"; count=count+1; } } if(document.formname.item4.checked) { if(count==4){ document.formname.item_name_4.value = "Item 4"; document.formname.amount_4.value = "11.00"; count=count+1; } if(count==3){ document.formname.item_name_3.value = "Item 4"; document.formname.amount_3.value = "11.00"; count=count+1; } if(count==2){ document.formname.item_name_2.value = "Item 4"; document.formname.amount_2.value = "11.00"; count=count+1; } if(count==1){ document.formname.item_name_1.value = "Item 4"; document.formname.amount_1.value = "11.00"; count=count+1; } } } //--> </SCRIPT> <!-- End of Script --> </head> <body> <!-- START SAMPLE CODE SECTION --> <!-- PARAGRAPH 1 --> Upload Method Examples <br><br> Check Boxes Utilizing a Script. r><br><br> <form name="formname" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <!-- If using a Business or Company Logo Graphic, include the "cpp_header_image" variable in your View Cart code. --> <input type="hidden" name="cpp_header_image" value="https://www.yourwebsite.com/logo.jpg"> <!-- Replace "business" value with your PayPal Email Address or Account ID --> <input type="hidden" name="business" value="your email address"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="upload" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="lc" value="US"> <!-- 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="button_subtype" value="products"> <input type="hidden" name="no_note" value="0"> <input type="hidden" name="cn" value="Add special instructions to the seller:"> <input type="hidden" name="bn" value="PP-ShopCartBF:btn_paynowCC_LG.gif:NonHosted"> <input type="hidden" name="amount_1"> <input type="hidden" name="amount_2"> <input type="hidden" name="amount_3"> <input type="hidden" name="amount_4"> <input type="hidden" name="item_name_1"> <input type="hidden" name="item_name_2"> <input type="hidden" name="item_name_3"> <input type="hidden" name="item_name_4"> <table> <tr> <td>CheckBox </td> <td>Item </td> <td>Price </td> </tr> <tr> <td> <input type="checkbox" name="item1" value="Item 1"></td> <td>Item 1 </td> <td>$2.00</td> </tr> <tr> <td> <input type="checkbox" name="item2" value="Item 2"></td> <td>Item 2 </td> <td>$5.00</td> </tr> <tr> <td> <input type="checkbox" name="item3" value="Item 3"></td> <td>Item 3 </td> <td>$9.00</td> </tr> <tr> <td> <input type="checkbox" name="item4" value="Item 4"></td> <td>Item 4 </td> <td>$11.00</td> </tr> </table> <br> <input type="button" value="Reset Form" onClick="this.form.reset()"> <br><br> <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" onclick="codename()" alt="Make payments with PayPal - it's fast, free and secure!"> <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> <!-- END BUTTON EXAMPLES --> <!-- END SAMPLE CODE SECTION --> <br><br><br><br> <hr align="left" width="50%" noshade> <br><br> NOTES: <br> In order to test the code, you must replace the "business" value variable with your PayPal Email Address or Account ID. </body> </html>

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Customer Signature window on IPAD. "SEND" button needs to be RELOCATED in About Payments (Archive)
- How can I custome my Buy Now button ? in About Business (Archive)
- Why do my buttons send to our account instead of the customers? in About Business (Archive)
- Resolve button isn't working, and customer service isn't responding in About Settings (Archive)
- Custom Button for 501(c)(3) in About Business (Archive)