[ic] Disable "Place Order" button after clicked

Admin interchange-users@icdevgroup.org
Thu May 8 19:58:01 2003


>-----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()=="reset"
)
//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

----------------------------------------------