Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Problem with PayPal Button

    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.ne...dle_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

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    This is your actual source code:

    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.

    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...
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • Users who have thanked Rowsdower! for this post:

    BSquared18 (09-13-2011)

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,928
    Thanks
    6
    Thanked 1,041 Times in 1,014 Posts
    OK, I know some people won’t like me for saying that but: Fix your HTML errors first. I can already see a lot of useless opening form tags that are never closed.

  • Users who have thanked VIPStephan for this post:

    BSquared18 (09-13-2011)

  • #4
    New Coder
    Join Date
    May 2007
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Thanks for the suggestions!

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

    Bill

  • #5
    New Coder
    Join Date
    May 2007
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •