Here are the functions I use to disable/enable buttons. The onclick of the
button would call the disbtn(). It would only need to be re-enabled if you
had some client side JS checks that found errors and popped up an alert() or
something. You'd want to call enbtn() so they cold give it another go.


<!--
function disbtn(frm, btn, txt)
{
        document.body.style.cursor='wait';
        eval('document.' + frm + '.' + btn + '.value=\'' + txt + '\'');
        eval('document.' + frm + '.' + btn + '.disabled=true');
}

function enbtn(frm, btn, txt)
{
        document.body.style.cursor='';
        eval('document.' + frm + '.' + btn + '.value=\'' + txt + '\'');
        eval('document.' + frm + '.' + btn + '.disabled=false');
}
//-->


Frm is the NAME of your form
Btn is the NAME of the button
Txt is simply the text you want disaplyed on the button. (VALUE of the
button's tag

I usually use 'Please Wait...' or 'Processing...'

Of course you know this is 80% cosemetics and 20% protection since JS can be
easily be turned off.

I've seen some pretty clever ideas on stopping double submits come through
this list. I'd check the archives for a server side solution.
 

..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com


-----Original Message-----
From: Damien McKenna [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 12, 2005 5:04 PM
To: CF-Talk
Subject: OT: Click-once submit button techniques?

Anyone got a simple JS function to block multiple submit-button clicks?
I've looked a few times but never found anything simple that worked and
was cross-browser compatible.  Thanks.

-- 
Damien McKenna - Web Developer - [EMAIL PROTECTED]
The Limu Company - http://www.thelimucompany.com/ - 407-804-1014
#include <stdjoke.h>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217990
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to