...

View Full Version : Problem with PayPal Button



BSquared18
09-13-2011, 04:00 PM
Hello,

I copied and pasted the code provided to me by PayPal to create a Pay Now button that users could click on. It is supposed to take them to a place on PayPal where they can pay for my services.

The code is shown below.
_________________________________________

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="S9Q66NEE8WMRU">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_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>

_________________________________________

However, instead of taking the user elsewhere, when the button is clicked, the user is simply taken to the top of the web page the button is on.

The address for the page in question is: http://browningwrite.home.comcast.net/~browningwrite/kindle_books.html

Because I code by hand rather than using an editor like Dreamweaver, the code isn't changed in the process of pasting it.

My website is a free one hosted by Comcast as part of my subscription. I don't know if that could be a factor.

Thanks for any suggestions you can give me.

Bill

Rowsdower!
09-13-2011, 04:15 PM
This is your actual source code:


<form><A HREF="#">
<center><font size="2"><strong>Back to Top</strong></font></A></center>
</p>
<br>
<!-- Subhead 2: Fund Transfer -->
<A NAME="funds">
<h1>Transferring Funds</h1>

<p>
<i><strong><font color="330099">PayPal. </font></i></strong>

If you're at all familiar with the Internet, chances are you've used, or at least heard of, PayPal.
Owned and operated by eBay, it's a simple, quick, and inexpensive way to transmit payments
between customers and vendors. I use PayPal to keep my overhead down and pass the savings
on to you in lower fees.
<br>
<br>
<center><img src="paypal_logo.jpg" alt="PayPal Logo" border="0"></center>
<p>
When you are paying for a product or service, PayPal costs you nothing; it's free.
All you need is an Internet connection and a bank account or credit card.
If you haven't already signed up for PayPal, you can do so at no charge.
<a href="javascript:openNewWindowPAYPAL();"><strong><font color="#7C0019">

<FONT FACE="arial" SIZE="2" COLOR="#7C0019" onmouseover="this.style.color='#3300FF'" onmouseout="this.style.color='#7C0019'">
CLICK HERE</font></strong></a> <font color="#000000"> to go to PayPal's official website
and learn more and/or sign up. If you use the button below, <strong>you
don't even need to establish a PayPal account</strong>. When finished with the PayPal site, close
the window to return here.
<br>
<br>
When you are ready to pay for my services, you can come to this website and click
on the button below.
<br>
<br>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="S9Q66NEE8WMRU">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_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>


Notice that you have a form element starting waaaay up at the top with no action and no method. Your submit button (the paypal button) is submitting this bigger form. A form with no action submits to itself (usually) and so you are going right back to the top of your own page.

Your best bet in general is to validate your page using the W3C HTML validator. You are currently showing 102 errors and 5 warnings (http://validator.w3.org/check?uri=http%3A%2F%2Fbrowningwrite.home.comcast.net%2F~browningwrite%2Fkindle_books.html&charset=%28detect+automatically%29&doctype=Inline&group=0&ss=1&verbose=1).

If you fix those errors and warnings then the button will work just fine. I know that 102 errors sounds daunting, but it's really not that bad to fix. Just start with a valid doctype and use the validator to patch things up one step at a time...

VIPStephan
09-13-2011, 04:16 PM
OK, I know some people won’t like me for saying that but: Fix your HTML errors (http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fbrowningwrite.home.comcast.net%2F~browningwrite%2Fkindle_books.html) first. I can already see a lot of useless opening form tags that are never closed.

BSquared18
09-13-2011, 04:41 PM
Thanks for the suggestions!

I'll be back when I've had a chance to work through them.

Bill

BSquared18
09-13-2011, 04:54 PM
Simply removing the <Form> codes from the Back to Top entries solved the problem!

Don't remember why I put them there to begin with. That was a long time ago.

Also, thanks for the idea of running the code through a validator.

Bill



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum