Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If I understand your question correctly, earlier, you created a form with a normal submit button. If a user enters all the input and clicks submit, you would send him an email. Right now, you replaced the normal button with a PayPal submit button and you wants that PayPal button to invoke the sending email function just like the old button. If that's what you want to do, you can try this way:</p> <pre><code>&lt;div id="paypal_button"&gt; // wrap your encrypted paypal button in a div &lt;/div&gt; // PayPal button is actually a form so you can make a script like the following &lt;script type="text/javascript"&gt; $("div#paypal_button &gt; form").submit(function() { // Call your sending email function here (maybe by using Ajax) }); &lt;/script&gt; </code></pre> <p><strong>EDIT</strong>: if you don't want to bind onclick event to the PayPal button itself, I think you should use this Ajax <a href="http://jquery.malsup.com/form/" rel="nofollow">plugin</a> to submit your original form (i.e. don't use normal submit because the user would be redirected to the page in action attribute and it'd be more difficult to achieve what you want).</p> <pre><code>&lt;form id="original_form" action="somePage"&gt; ... &lt;input type="submit" value="Submit" /&gt; &lt;/form&gt; &lt;div id="paypal_button" style="display:none"&gt; // wrap your encrypted paypal button in a HIDDEN div &lt;/div&gt; &lt;script type="text/javascrip"&gt; $(document).ready(function() { // submit your original form to send the email and redirect the user on success $('#original_form').ajaxForm({ success: function() { $("div#paypal_button &gt; form").submit(); } }); }); &lt;/script&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload