Solved

Paypal button does not submit

Posted on 2013-02-02
10
328 Views
Last Modified: 2016-03-24
I generated a PayPal payment button from the PayPal website and dropped the button onto my page and nothing happens when I click the button.  What am I doing wrong?  Where do I begin?

Here is the button.

<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="1234567">
<table>
<tr><td><input type="hidden" name="on0" value="MyService">My Service</td></tr><tr><td><select name="os0">
<option value="Category1">Product 1 $65.00 CAD</option>
<option value="Category2">Product 2 $140.00 CAD</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="CAD">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_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>

Open in new window


Thanks.
0
Comment
Question by:DanielAttard
  • 5
  • 4
10 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 38847297
line 11, replace :  name="submit"
by :  name="mysubmit"

in you put your form in an iframe :
line 1, replace :
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
by :
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
0
 

Author Comment

by:DanielAttard
ID: 38847312
Thanks leakim971, I think there is a type in your comment.  What is it you are telling me about iframe?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38847313
do you have your paypal form inside an iframe?
0
 

Author Comment

by:DanielAttard
ID: 38847314
No, I don't.  Not familiar with iframe.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38847321
so what about ?
line 11, replace :  name="submit"
by :  name="mysubmit"

Open in new window


You add jQuery and Javascript zone, please post your code
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:DanielAttard
ID: 38847323
I am trying to make a call to the paypal form inside this js function:

function() {    
    // need call to PayPal here, before myStep1 and myStep2 
    $.when.apply(undefined, myStep1()).done(function () {
    $.ajax({
        url: sURL + "myController/myStep2",
        success: function() {  
                $.msg("Success Message", live:10000
                });
            },
        error: function(){
                $.msg("Error Message", live:10000
                });
            }
        }); 
    });
};

Open in new window


This is the paypal form that I am trying to implement, but the form does not submit when I click the button:

<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="123456789">
  <input type="image"
      src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_SM.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>

Open in new window


Any ideas why my form does not submit?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38847329
Any ideas why my form does not submit?
Not really, sorry...
Please wait help from other EE members
0
 

Author Comment

by:DanielAttard
ID: 38847335
Ok, thanks anyway.  Frustrating afternoon for me  . . . .
0
 
LVL 14

Accepted Solution

by:
dejaanbu earned 500 total points
ID: 38847997
but the form does not submit when I click the button:

i just copied your code and accessed the page, i am redirected to paypal results, i mean the page is submitting on click of the image.

can u give more detail?

also, i would recommend using Sandbox first, then later after everything get succeeded, u can move to live paypal. so try creating sandbox hosted button first, then change the url to "https://www.sandbox.paypal.com/us/cgi-bin/webscr" and then test everything..
0
 

Author Closing Comment

by:DanielAttard
ID: 38900526
Thanks for the suggestion to use the sandbox mode.  This helped me solve the problem.  Thanks.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now