[ic] Disable "Place Order" button after clicked

Joshua Lavin interchange-users@icdevgroup.org
Fri May 9 05:03:01 2003


On Thursday, May 8, 2003, at 06:57  PM, Admin wrote:

>> -----Original Message-----
>> From: interchange-users-admin@icdevgroup.org
>> [mailto:interchange-users-admin@icdevgroup.org]On Behalf Of Kevin Old
>> Sent: Thursday, May 08, 2003 9:24 AM
>> To: Interchange Users
>> Subject: [ic] Disable "Place Order" button after clicked
>> Hello everyone,
>> I have had several orders that have been submitted twice in the past  
>> few
>> days, due to users double-clicking on the "Place Order" button.
>>
>> I know how to accomplish this with javascript and have tried to  
>> combine
>> that with the "confirm" parameter for the button tag, but my tag ends  
>> up
>> looking like this:
>>
>> <input TYPE="submit" NAME="mv_click" VALUE="Place Order"  
>> onclick="return
>> confirm('javascript: mv_click.disabled==true;')">
>>
>> Can anyone offer suggestions on how to get around this?
>>
>> Thanks,
>> Kevin
>> --
>> Kevin Old <kold@carolina.rr.com>
>
>
>
> We use the following in the HEAD HTML
>
> <script>
> function submitonce(theform){
> //if IE 4+ or NS 6+
> if (document.all||document.getElementById){
> //screen thru every element in the form, and hunt down "submit" and  
> "reset"
> for (i=0;i<theform.length;i++){
> var tempobj=theform.elements[i]
> if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="r 
> eset"
> )
> //disable em
> tempobj.disabled=true
> }
> }
> }
> </script>
>
> Then the form action
>
> <FORM ACTION="[process secure=1]" METHOD="POST"
> onSubmit="submitonce(this)">
>
> Disables the "submit" button on click
>
> HTH
>
> Russ Smith
> VS-Host.com
> http://vs-host.com

Russ,

I tried this method, and it does disable the submit and reset buttons,  
but it returns me to the checkout page as if nothing had happened. No  
error, nothing. It doesn't matter what credit card number I use.

Taking the onSubmit out causes the page to fail the CC number, or go to  
the receipt page, as normal.

This is 4.8.7. Note that I did not place the script in the head, but in  
the body (shouldn't make any difference).

It seems like there needs to be some return to have IC handle the  
checkout, I don't know. Have you experienced this, or is your working  
code perhaps slightly different?

Thanks,
Josh