I'm glad you said that, as that was my take on it too. I don't have
terribly great Javascript skills, so I assumed there was something I was
missing. The thing is, the doesn't work as you would expect it to.
If the submit button is only pressed once, nothing should happen, right?
Yet the form is submitted properly. If I comment out the
.object.form.submit(); line entirely, it seems to make no difference as
the form works the same way. I suspect it's because this is a submit
button and the function always returns true? Isn't the
.object.form.submit(); line redundant? Moving this line didn't make any
difference either.
I changed it to
.function verify (object) {
.if (btnPress == false) {
.btnPress = true;
. return true; }
.else {
.object.disabled=true;
.return false; }
.}
It hasn't made any difference.
Is there another approach I can take?
Diane
Bj wrote:
It still allows the button to be pressed a couple of
times before getting disabled if it's pressed quickly
though. Any idea why?
None I'm afraid! Sounds as if the second click was running a second instance
of the script before the first one had set the flag, sounds unlikely, maybe
it's the code.
My function is:
Your function looks nice and tidy but somehow wrong. If I am reading it correctly it
says "if this is the first time you click the button, set the flag and do nothing
else; on second and subsequent clicks, disable the form and submit it"
I think you want the 'submit' right after the 'set the flag' as in:
.var btnPress = false;
.function verify (object) {
. if (btnPress == false) {
. btnPress = true;
. object.form.submit(); }
. else
. object.disabled=true;
. return true;
.}
Could be worth a try
-----------------------------------------
Email sent from www.ntlworld.com
Virus-checked using McAfee(R) Software
Visit www.ntlworld.com/security for more information
____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.
____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: unknown lmsubst tag argument: ''
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.