Registration Form with a Button: Am I Doing It Right?

mikejohn
Contributor
Contributor

I am trying to use a button on a 5K registration form that sends me the registration information as well as pays for the race registration.

 

I coded it mostly myself using dusted off HTML knowledge from the late 90's as well as some google searches.

 

It looks good (to me at least) but I'm not sure if if will get all of the registration form info once a payment is received.

 

Can you tell from my code?

 

http://www.lifeatpathway.com/what-s-happening/mukti-5k-registration

 

Thanks!

Login to Me Too
5 REPLIES 5

mikejohn
Contributor
Contributor

Now it looks like I'm getting an error message when I click the button.  The error is, "PayPal cannot process this transaction because of a problem with the seller's website. Please contact the seller directly to resolve this problem."

 

 

And I can't post my html here (as text, code, or word) because it says it's invalid.  Argh!

Login to Me Too

snowshoe
Frequent Advisor
Frequent Advisor

The problem with your code is that you are using "hosted" item button code.   The online button creator has it's limitations and will only allow you to include two text input fields.  If you need more, you have to take a different approach.

 

What you need to do is manually create the item button code and use the "option" variables for your text input fields and your dropdowns.  See the example below for starters, one is a Buy Now and the other is an Add to Cart.

 

<!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 -->
Basic Examples

<br><br>

Add to Cart and Buy Now Example, Multiple Text Input.

<br><br>

Notes:
<br>
* This example demonstrates how to do the same thing using either a Buy Now Item Button or Add to Cart Item Button.


<br><br>
<hr align="left" width="50%" noshade>
<br><br>

<!-- START CONTENTS -->

<!-- START BUTTON EXAMPLES -->

<!-- START BUTTON EXAMPLES -->

<!-- Start of Buy Now Form -->
Widget Statue Trophy - $100.00 plus $20.00 shipping

<br><br>

<!-- Start of Buy Now Form -->
<**bleep**">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="_xclick">
<!-- 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" value="Widget Statue">
<input type="hidden" name="item_number" value="WS-1001">
<input type="hidden" name="amount" value="100.00">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="2">
<!-- 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">
<!-- Note: shipping override variable is used with this example -->
<input type="hidden" name="shipping" value="20.00">
<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-BuyNowBF:btn_buynow_LG.gif:NonHosted">
<!-- -->
Name Plate Engraving Information:
<br><br>

First Name:&nbsp;&nbsp;
<input type="hidden" name="on0" value="First Name">
<input type="text" name="os0" size="20">
<br><br>
Last Name:&nbsp;&nbsp;
<input type="hidden" name="on1" value="Last Name">
<input type="text" name="os1" size="20">
<br><br>
School:&nbsp;&nbsp;
<input type="hidden" name="on2" value="School">
<input type="text" name="os2" size="20">
<br><br>
Event:&nbsp;&nbsp;
<input type="hidden" name="on3" value="Event">
<input type="text" name="os3" size="20">
<br><br>
Date:&nbsp;&nbsp;
<input type="hidden" name="on4" value="Date">
<input type="text" name="os4" size="8">
<br><br>
Team Name:&nbsp;&nbsp;
<input type="hidden" name="on5" value="Team Name">
<input type="text" name="os5" size="20">
<br><br>
Place:&nbsp;&nbsp;
<input type="hidden" name="on5" value="Place">
<input type="text" name="os5" size="20">
<br><br>
<!-- -->
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_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 Buy Now Form -->


<br><br>
<hr align="left" width="50%" noshade>
<br><br>



<!-- Start of Add to Cart Form -->
Widget Statue Trophy - $100.00 plus $20.00 shipping

<br><br>

<!-- Note: target="paypal" was replaced with target="_self" -->
<!-- Note: shopping_url also added to code -->
<!-- These two changes allow better functionality with IE and Firefox --> 
<**bleep**">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="_cart">
<input type="hidden" name="add" value="1">
<!-- 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" value="Widget Statue">
<input type="hidden" name="item_number" value="WS-1001">
<input type="hidden" name="amount" value="100.00">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="2">
<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_cart_LG.gif:NonHosted">
<!-- Replace value with the web page you want the customer to return to -->
<input type="hidden" name="shopping_url" value="http://www.yourwebsite.com/Shop.html">
<!-- 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">
<!-- Note: shipping override variable is used with this example -->
<input type="hidden" name="shipping" value="20.00">
<!-- -->
Name Plate Engraving Information:
<br><br>

First Name:&nbsp;&nbsp;
<input type="hidden" name="on0" value="First Name">
<input type="text" name="os0" size="20">
<br><br>
Last Name:&nbsp;&nbsp;
<input type="hidden" name="on1" value="Last Name">
<input type="text" name="os1" size="20">
<br><br>
School:&nbsp;&nbsp;
<input type="hidden" name="on2" value="School">
<input type="text" name="os2" size="20">
<br><br>
Event:&nbsp;&nbsp;
<input type="hidden" name="on3" value="Event">
<input type="text" name="os3" size="20">
<br><br>
Date:&nbsp;&nbsp;
<input type="hidden" name="on4" value="Date">
<input type="text" name="os4" size="8">
<br><br>
Team Name:&nbsp;&nbsp;
<input type="hidden" name="on5" value="Team Name">
<input type="text" name="os5" size="20">
<br><br>
Place:&nbsp;&nbsp;
<input type="hidden" name="on5" value="Place">
<input type="text" name="os5" size="20">
<br><br>
<!-- -->
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_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 Add to Cart Form -->

<!--  Start of View Cart Button Code  -->
<**bleep**">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="_cart">
<input type="hidden" name="display" value="1">
<!-- Replace "business" value with your PayPal Email Address or your Merchant Account ID -->
<input type="hidden" name="business" value="your email address">
<!-- Replace value with the web page you want the customer to return to -->
<input type="hidden" name="shopping_url" value="http://www.yourwebsite.com/Shop.html">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_viewcart_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 View Cart Button Code  -->



<!-- 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

mikejohn
Contributor
Contributor

OK I updated the text boxes to objects, but I'm not sure how to do the drop-downs.

 

Also, I think I made the Add to Cart button worse somehow as it just goes to a blank page.

 

Here is my code.  **bleep** is in a few non-essential spots and I swapped my actual email for "myemailwashere" in the spots I had it.

 

<**bleep**">https://www.paypal.com/cgi-bin/webscr" method="post" target="_self"><input type="hidden" name="cmd" value="_cart" /> <input type="hidden" name="add" value="1" /> <input type="hidden" name="myemailaddresswashere" value="myemailaddresswashere" />
<table>
<tbody>
<tr>
<td>First name:</td>
</tr>
<tr>
<td><input type="hidden" name="on0" value="First Name" /> <input type="text" name="os0" size="30" /></td>
</tr>
<tr>
<td>Last name:</td>
</tr>
<tr>
<td><input type="hidden" name="on1" value="Last Name" /> <input type="text" name="os1" size="30" /></td>
</tr>
<tr>
<td>Address:</td>
</tr>
<tr>
<td><input type="hidden" name="on2" value="Address" /> <input type="text" name="os2" size="30" /></td>
</tr>
<tr>
<td>City:</td>
</tr>
<tr>
<td><input type="hidden" name="on3" value="City" /> <input type="text" name="os3" size="20" /></td>
</tr>
<tr>
<td>State:</td>
</tr>
<tr>
<td><input type="hidden" name="on3" value="State" /> <input type="text" name="os3" size="2" /></td>
</tr>
<tr>
<td>Zip:</td>
</tr>
<tr>
<td><input type="hidden" name="on3" value="Zip" /> <input type="text" name="os3" size="10" /></td>
</tr>
<tr>
<td>Phone:</td>
</tr>
<tr>
<td><input type="hidden" name="on3" value="Phone" /> <input type="text" name="os3" size="14" /></td>
</tr>
<tr>
<td>Email:</td>
</tr>
<tr>
<td><input type="hidden" name="on3" value="Email" /> <input type="text" name="os3" size="30" /></td>
</tr>
<tr>
<td>Age:</td>
</tr>
<tr>
<td><input type="hidden" name="on3" value="Age" /> <input type="text" name="os3" size="2" /></td>
</tr>
<tr>
<td>Gender:</td>
</tr>
<tr>
<td><select name="gender"><option value="">- please select -</option><option value="male">Male</option><option value="female">Female</option></select></td>
</tr>
<tr>
<td>Race</td>
</tr>
<tr>
<td><select name="race"><option value="">- please select -</option><option value="5k">Mukti 5K Race $15.00 USD</option><option value="1m">Mukti 1 Mile **bleep** $15.00 USD</option></select></td>
</tr>
<tr>
<td><input type="hidden" name="on1" value="Shirt Size" />Shirt Size</td>
</tr>
<tr>
<td><select name="shirt"><option value="">- please select -</option><option value="Youth Small">Youth Small</option><option value="Youth Medium">Youth Medium</option><option value="Youth Large">Youth Large</option><option value="Adult Small">Adult Small</option><option value="Adult Medium">Adult Medium</option><option value="Adult Large">Adult Large</option><option value="Adult XL">Adult XL</option><option value="Adult XXL">Adult XXL</option></select></td>
</tr>
<tr>
<td colspan="2" align="center">
<div> </div>
<div><input type="checkbox" name="agree" value="agree_terms" /> By checking this box, I, intending to be legally bound **bleep** on Saturday, May 10, 2014. I shall abide by all decisions of race officials as final. I also release the sponsoring organizations and individuals from all legal responsibility or liability for the use of any photographs involving me for the purpose of advertising or reporting.</div>
</td>
</tr>
</tbody>
</table>
<input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" alt="PayPal - The safer, easier way to pay online!" /> <img src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" alt="" width="1" height="1" border="0" /></form>

 

Login to Me Too

snowshoe
Frequent Advisor
Frequent Advisor

Sorry, right now there's an issue with forum posts as certain words are being replaced with this:  **bleep**

 

Unfortunally to correct your code at this point would take a bit of time as it would require a rewrite.  What I can suggest at this point is to visit this site for coding ideas.

http://ccaples.com/index.php/basic-scripts

 

Login to Me Too

mikejohn
Contributor
Contributor

OK I re-wrote much of it after looking at that website (specifically http://ccaples.com/index.php/basic-scripts/examples-ii/membership).

 

Now I get a different error when clicking Pay Now.

 

http://www.lifeatpathway.com/what-s-happening/mukti-5k-registration

 

 

I think the form part is clean now, but the button script (lines 628 and 714-15) can't be right.

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.