PDA

View Full Version : 2 Buttons in 1 form


QBall777
07-23-2008, 12:58 PM
Hi

I have a shopping cart that transfers the order to Paypal when the user clicks the checkout button. I now want to add a Google checkout option. I want the user to have the choice of payment methods.

If I have two buttons in one form how do they get directed to the correct pages?

This is my code with just the Paypal option.
<%

if Request("CC_OrderInsert") <> "" then
Response.Redirect "TransferOrderPaypal.asp"
end if

%>

Many Thanks

QBall777
07-25-2008, 12:49 PM
This is the way to redirect to the correct page but I need the order details to be saved to the database first.

<%
'
'**Save cart to OrderDetails table in Database**
'
if Request("CC_OrderInsert") <> "" then
objCart.OrderDetailsTable="OrderDetails"
objCart.OrderDetailsConnectionString=MM_CharonCart_STRING
objCart.Bindingvalues=("ProductID,Quantity,ProductName,UnitPrice,,,Colour,ProductSize")
objCart.Bindingcolumns=("ProductID,Quantity,Name,Price,Weight,Key,Colour,Size")
objCart.OrderIdColumn="OrderID"
objCart.InsertOrderDetails

end if
%>



<input name="Submit2" type="submit" class="cartbutton" value="Submit Order with Paypal" onClick="this.form.action='Paypal.asp';">
</br></br>
<input name="Submit3" type="submit" class="cartbutton" value="Submit Order with Google" onClick="this.form.action='google.asp';">

Anyone got any ideas???