Solved

Paypal button does not submit

Posted on 2013-02-02
10
326 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
Comment Utility
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
Comment Utility
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
Comment Utility
do you have your paypal form inside an iframe?
0
 

Author Comment

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

Expert Comment

by:leakim971
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:DanielAttard
Comment Utility
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
Comment Utility
Any ideas why my form does not submit?
Not really, sorry...
Please wait help from other EE members
0
 

Author Comment

by:DanielAttard
Comment Utility
Ok, thanks anyway.  Frustrating afternoon for me  . . . .
0
 
LVL 14

Accepted Solution

by:
dejaanbu earned 500 total points
Comment Utility
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
Comment Utility
Thanks for the suggestion to use the sandbox mode.  This helped me solve the problem.  Thanks.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
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…

772 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

14 Experts available now in Live!

Get 1:1 Help Now