Checkout Confirmation
Checkout Confirmation
My company is trying to write a javascript confirmation check on the "Pay with Card" button on the opc.aspx checkout page(one page checkout option selected). We want to have the user confirm that they want to follow through with the transaction. The button already has a script written on the "OnClientClick" attribute that prevents user from submitting order twice. Is there a way to do this without removing the functionality for submitting the order twice. Any help on this will be appreciated.
Re: Checkout Confirmation
Simply edit ConLib/Checkout/PaymentForms/CreditCardPaymentForm.ascx file and then update following code responsible to stop form re-submission.
to something like this
Finally in your ascx file you need to add a javascript method for your confirmation code.
Code: Select all
CreditCardButton.OnClientClick = "if (Page_ClientValidate('" + this.ValidationGroup + "')) { this.value='Processing...';this.onclick=function(){return false;}; }";
Code: Select all
CreditCardButton.OnClientClick = "if (Page_ClientValidate('" + this.ValidationGroup + "') && getConfirmation()) { this.value='Processing...';this.onclick=function(){return false;}; }";
Code: Select all
<script>
function getConfirmation() {
return confirm("Are you sure you want to proceed with payment?");
}
</script>