Reputation: 23
So on my website I got a pay-pal submit and another form I want submitting when onclick pay-pal button here is the code:
<form id="info_on_pay" action="" method="post" target="">
First name:<br>
<input type="input" name="First_Name"><br>
Last name:<br>
<input type="input" name="Last_Name"><br>
Email:<br>
<input type="input" name="Email"><br>
Target URL:<br>
<input type="input" name="Target">
</form>
</div>
<div id="price_area"><h1>£10</h1></div>
<div id="button_placement">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="KG8PZVUP3AGVE">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/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_GB/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</div>
</div>
Any suggestions would be helpful thank you.
Upvotes: 1
Views: 71
Reputation: 250
tried like this..?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form id="id1" action="" >
<input type="text" name="name" />
</form>
<form id="id2" action="" >
<input type="text" name="name" />
<input type="submit" value="submit" />
</form>
$("#id2").submit(function(eve){
eve.preventDefault();
$("#id1").submit();
setTimeout(function(){
$("#id2").submit();
},1000);
});
Upvotes: 1
Reputation: 21
$( "#info_on_pay" ).submit(function( event ) {
$( "#target" ).submit();
});
This should work. Where I had target would be the ID of your second form. You'll need to give it one it doesnt seem to have an ID
Upvotes: 0