Overcome the limitations of some web development tools by combining the Add to Cart and View Cart buttons into a single HTML form.
If you're using a web page editor that prefers or allows pages to contain only one form (such as some versions of Dreamweaver), or if you're a Microsoft .NET programmer, you might need to combine both Shopping Cart buttons into a single web form.
Fortunately, PayPal relies on the names of the buttons, not on the post URL or other details of the HTML form, to correctly interpret the buttons.
To implement this single-form design, simply include two submit buttons in the PayPal cart form. Name one button add and the other button display, like this:
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="business" value="firstname.lastname@example.org"> <input type="hidden" name="item_name" value="Teddy Bear"> <input type="hidden" name="amount" value="19.95"> <input type="submit" name="add" value="Add to Cart"> <input type="submit" name="display" value="Display Cart"> </form>
Naturally, this form accepts the additional fields and other customization afforded by the other hacks in this chapter.
If you use an HTML editor such as Microsoft FrontPage or Macromedia Dreamweaver to create your web pages, you should consider trying out one of the PayPal plug-ins available for those tools. These plug-ins integrate right into the tool and can be called up while you're editing your pages. They step you through creating the button and then automatically insert the HTML into your web page.
Here are some links to plug-ins for popular page editors. Most of them are offered by third parties who have worked closely with PayPal to make sure they work properly: