|
|
Putting text around a Paypal button?I have added a Paypal button to my weblog but I can't figure out how to put the text above or below the buy now button so that people know that they are buying before they click on it. I am just learning about HTML? Glad to hear that you're joining the world of ecommerce and I appreciate the simplicity and reliability that Paypal offers - heck, I use it too, on this site - and I also understand your challenges with integrating the Paypal buttons into your existing site design. So let's dig into this a bit... First off, let me grab one of the buttons off my Buy Dave A Chai page (where you can thank me for my free efforts on this site by buying me a nice warm spiced tea, or two!). The button looks like this:
That's not too unattractive, but let's have a look at the code underneath it, shall we?
<form name='_xclick' action='https://www.paypal.com/cgi-bin/webscr' method='post'> <input type='hidden' name='cmd' value='_xclick' /> <input type='hidden' name='currency_code' value='USD' /> <input type='hidden' name='item_name' value='Buy Dave a chai' /> <input type='hidden' name='no_shipping' value='1' /> <input type='hidden' name='rm' value='2' /> <input type='hidden' name='cbt' value='Return to Ask Dave Taylor!' /> <input type='hidden' name='amount' value='4.50' /> <input type='submit' value="Buy Dave a grande soy chai: $4.50" /> </form> This is rather intimidating, so I can understand your reticence when it comes to getting it working on your page, but here's the secret: HTML forms lay out exactly like a <div> block does (or, if you're an old school HTML coder, a <p> block). With this knowledge, you should be able to see that you can drop a form into a table element and then use other cells of the table to put text around the button (or, even better, have the form and the additional text all in the table, but have the begin and end <form> tag outside the table for even easier layout). For example, if I wanted to tuck some small print immediately below the button, it might look like this:
<form name='_xclick' action='https://www.paypal.com/cgi-bin/webscr' method='post'> <input type='hidden' name='cmd' value='_xclick' /> <input type='hidden' name='currency_code' value='USD' /> <input type='hidden' name='item_name' value='Buy Dave a chai' /> <input type='hidden' name='no_shipping' value='1' /> <input type='hidden' name='rm' value='2' /> <input type='hidden' name='cbt' value='Return to Ask Dave Taylor!' /> <input type='hidden' name='amount' value='4.50' /> <center> <input type='submit' value="Buy Dave a grande soy chai: $4.50" /> <div style="font-size:60%">Dave's surprisingly thirsty right now!</div> </center> </form> This will format nicely as:
See how that works? Forms are just another block element on a page, so you can really push them around and place them as you would any other block, through an overarching table design for layout, if you'd like, or with CSS positioning (relative or absolute) or even by using attributes like align= (with some experimentation). Finally, note that there's nothing special about a weblog entry either, so there's no reason you couldn't have a Paypal button in your entry directly (as I have with this article!) by cutting and pasting in the block of content from Paypal's button builder. Hope that gets you started in the right direction, and if you are interested in learning more about HTML, may I recommend my best-selling book Creating Cool Web Sites with HTML, XHTML and CSS, from J. Wiley & Sons?
More Useful HTML, JavaScript and Web Site Programming Articles:
✔ How to Create Predefined Google Image Search Links?
Thanks for the Amazon URL [see Creating Amazon Search Links]. That worked beautifully. In fact, I sent you $5.00 for coffee in thanks....
✔ Can I embed a Facebook search box on my blog site?I've seen your articles about how to add a Twitter or Google search box on a Web page, but I have a tougher...
✔ Can I use CSS for drop shadows on my blog?I want to give my site a bit of a facelift and add some neat graphical elements. One of which is drop shadows....
✔ How can I embed interactive photo panoramas on my site/blog?I read through your blog entry about how to take panoramic photos with iOS 6 and an iPhone 5 and got enthused. I've...
✔ How can I create a Twitter search URL shortcut?I'd like to add a few Twitter search links to my Web site. Is that possible, or does Twitter prohibit this sort of...
Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help
right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
Categorized:
HTML, JavaScript and Web Site Programming
(Article 4304,
Written by Dave Taylor)
Tagged: online transactions, paypal, paypal customization, shopping carts Previous: How can I raise money from Venture Capitalists? Next: How do I delete all but one directory in Linux? Reader Comments To Date: 2wrybread said, on July 15, 2006 4:11 AM:
Note that the above code examples are incomplete and won't work, he's leaving out a bunch of fields. If you want it to work, reveal the source on the page and use the source from one of his actual buttons. And thanks for putting up this page, it helped me out, but why not put up actual working examples?
I do have a comment, now that you mention it!Check This Out Too... |
Recent Entries
Look for Answers
Recommended
All Our Categories
Apple iPad Help
Articles and Reviews Auctions and Online Shopping Blogs and Blogging Building Web Site Traffic Business and Management Computer and Internet Basics d) None of the Above Facebook Help Google Gmail Help Google Plus Help HTML, JavaScript and Web Site Programming Industry News and Trade Shows iPhone and Cell Phone Help iPod, Sony PSP and MP3 Player Help Kindle Fire Help Mac OS X Help Pay Per Click (PPC) Advertising Pinterest Help Search Engine Optimization (SEO) Shell Script Programming Tech Support Video Help The Writing Business Twitter, LinkedIn and Social Network Help Unix and Linux Help Video Game Tips and Help Windows PC Help Find Me on Google+ ADT on G+ |
I'm running b2evolution - I'd like to put in a paypal button but have no idea how/where to insert the code.
Thanks MajorHart majorjh@socket.net