Execute javascript before form is submitted on clicking a Paypal button -
i'm trying execute js right before paypal button clicked, this:
$('#paypal-button-container form').submit(function(){ beforepaypalsubmit(); }); the contents of beforepaypalsubmit() are:
function beforepaypalsubmit() { $.ajax({ type: 'get' , url: urls.beforepaypalsubmit , data: { id: state.id } , async: true }); } this simple ajax call should result in database row being inserted isn't. 0 php error in logs. actually, url doesn't gets called (checked in access log). if simple alert() instead of beforepaypalsubmit(), gets called. missing?
try putting onclick event on element clicked , submits form. code within onclick fired before submit.
Comments
Post a Comment