Somewhat along the same lines as this older post…
I had a "purchase" page where I wanted to allow the user to either purchase items on the site via credit card, or they could choose to pay via paypal. So two buttons. One that says "Pay with Credit Card" another that says "Pay with Paypal"… the paypal button should submit the form to paypal. The pay with credit card should submit the form to the next step on the site itself.
So in this case the form tag looks like this (with nothing in the value for action) :
<form name="paymentform" action="" method="post">
And the submit buttons look something like this:
<input type="button" name="paypal" value="Pay by PayPal" onClick="document.paypalForm.action='https://www.paypal.com/cgi-bin/webscr'; document.paymentform.submit();" />
<input type="button" name="creditcard" value="Pay by Credit Card" onClick="document.paymentform.action='paymentinfo.php'; document.paymentform.submit();" />
One thing to note – do NOT name any of the buttons "submit" otherwise it won't work.