[ic] Disable "Place Order" button after clicked

Joshua Lavin interchange-users@icdevgroup.org
Thu May 8 20:20:01 2003


> 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

This sounds like a good way to do it. I have currently implemented:

<FORM ACTION="[process secure=1]" METHOD="POST" name=checkout  
onSubmit="mv_click.disabled=true;">

And then I had to make my submit button with
<input type="submit" name="mv_click" value="Place Order">
instead of the button tag.

But I must have screwed something up because now when removing an item  
or changing the country, it gives errors about not having entered a  
credit card number.

I'll have to try your method.

Josh