Forum Moderators: buckworks

Message Too Old, No Replies

Buy Button Code Snippet Needed

How to disable a form button after it's clicked

         

dotme

7:38 pm on Nov 10, 2004 (gmt 0)

10+ Year Member



I have an odd request, but this is probably the best forum for it. An ecommerce site using AIM on AuthorizeNet has SSL and a form to submit the data.

But if you're quick and/or dumb enough, you can click the pay now button twice before the next page loads and conceivably get double-charged.

Does anyone have any javascript code that greys-out that Pay form SUBMIT button immediately when it's clicked, to prevent people from accidentally clicking it twice?

TIA

JD

duckhunter

7:45 pm on Nov 10, 2004 (gmt 0)

10+ Year Member



FormElementName.disabled = true

UltraCartJohn

9:04 pm on Nov 19, 2004 (gmt 0)



Here is a sample:

<form method=post action="http://www.myserver.com/">
<input type=submit value="Pay Now!" onclick="this.disabled = true;">
</form>

Hope this helps!

John