Home › Forums › Quform PHP › How can i run a paypal script on form submit
- This topic has 2 replies, 2 voices, and was last updated 8 years, 9 months ago by digital4u.
- AuthorPosts
- February 18, 2016 at 1:02 pm #18243digital4uParticipant
Hello,
At the form I am building I was asked to include paypal payment method. For that i have a script that initiate by a button click and calls another inpage javascript. The button has the format:
'<button id="pn1" class="paynow-button paynow-type-buynow paynow-style-default paynow-enable-transit"
data-business="info@photolab.gr"
data-item_name="Metalprint order - Photolab.gr"
data-amount="100"
data-quantity="1"
data-currency_code="EUR"
data-return="http://photolab.gr" type="submit" value="Send">Buy Now</button>'When the above button is clicked, it opens paypal with all necessary info for a purchase based on what user had chosen.
How can I make that button submit the form as well before changing page? The id=”pn1″ and the data are necessary.
The script that runs inpage is
'<script type="text/javascript">
$(document).ready(function(){
$('#pn1').paynow({
type: 'buynow',
style: 'default',
beforeSubmit: function(vars){
vars['amount'] = document.getElementById("timi").value;
return vars;
},
tooltip: 'Αγορά μέσω PayPal!'
});
});
</script> 'and there is also a jQuery.js loaded to assist all the above. The page i am building is http://photolab.gr/pages/metalprint/ .
February 22, 2016 at 5:38 pm #18260AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
February 29, 2016 at 2:50 pm #18322digital4uParticipantThank you very much, your js worked perfectly! Excellent support!
- AuthorPosts
- You must be logged in to reply to this topic.