Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 Gray our and disable submit button
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bmw000
VP-CART New User

137 Posts

Posted - January 02 2007 :  20:03:22  Show Profile  Visit bmw000's Homepage  Reply with Quote
Is there a way to gray out and disable the submit button, when a customer presses the submit button on the credit card details page.

This prevents them from pressing the submit button twice and causing a second transaction.

I have seen this done on other shopping sites I have purchased products from.

How do you impement this into vpasp?

Brian Weber
Variety Solutions, LLC
http://www.varietysolutions.com

Kidd
VP-CART Super User

Australia
373 Posts

Posted - January 03 2007 :  06:53:52  Show Profile  Reply with Quote
after the customer pressed the continue button VP-ASP brings the customer to shopthanks.asp, i dont understand how can they press the button twice and causing double transaction?
Go to Top of Page

bmw000
VP-CART New User

137 Posts

Posted - January 03 2007 :  08:52:41  Show Profile  Visit bmw000's Homepage  Reply with Quote
It doesn't go to shopthanks until the credit card has been processed, so if it is slow for some reason, it can hang on the page giving the customer a chance to double click.

Also, some people double click really quickly causing a duplicate transaction.

Brian Weber
Variety Solutions, LLC
http://www.varietysolutions.com
Go to Top of Page

jubjub
VP-CART New User

110 Posts

Posted - January 03 2007 :  15:52:01  Show Profile  Reply with Quote
Are you using a payment gateway? I guess you'd have to do an "onclick" call on the submit button and use Javascript to disable the button. I'm guessing it will be different depending on your payment gateway.
Go to Top of Page

bmw000
VP-CART New User

137 Posts

Posted - January 03 2007 :  16:05:34  Show Profile  Visit bmw000's Homepage  Reply with Quote
I use the linkpoint API gateway.

Brian Weber
Variety Solutions, LLC
http://www.varietysolutions.com
Go to Top of Page

support
Administrator

4679 Posts

Posted - January 03 2007 :  16:48:57  Show Profile  Visit support's Homepage  Reply with Quote
Open lapishopcheckout.asp and locate around line 140:
Response.Write("<form name=form1 method=Post action='" & getsess("currenturl") &"'>")

Change it to:
Response.Write("<form name=""paymentform"" method=Post action='" & getsess("currenturl") &"'>")

Then locate the following code at around line 163:
shopbutton Getconfig("xbuttoncontinue"),getlang("langCommonContinue"),"Action"

Change it to:
response.write "<input type=""submit"" name=""submitpayment"" value=""" & GetLang("langCommonContinue") & """ onclick=""disablebutton()"">"

You will notice that the name is no longer "Action", this is because data from disabled form elements do not get transferred. So add a hidden field that has the name of "Action" below the submit button:
response.write "<input type=""hidden"" name=""Action"" value="""">"

Then finally, you will need to add the Javascript function
"setdisabled(this)", put it in shoppage_header.htm with the "clearfield" function:
function disablebutton() {
var submitbutton = document.paymentform.submitpayment;
var actionfield = document.paymentform.Action;

if(submitbutton.disabled==false) {
submitbutton.disabled=true;
actionfield.value='Yes';
}
}

Please note this code has not been tested in a live environment and is not supported.

If the code changes do not work as required please let us know and we will forward onto our development team who will be happy to provide an no obligation estimate for you.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00