Does anyone know how to prevent double clicking on a submit button? People are double clicking my submit button and there for it is sending two messages. I have never heard of a way to prevent it do you?
Have you actually duplicated this double-click action yourself? Are you sure it isn't just people hitting refresh on the page where the form posts?
I say this because I keep on seeing people ask about this double-click submit problem, and I have tried several times to duplicate it with a standard HTML form, submitting to a standard form handler, in both Netscape and IE, and I have NEVER been able to get two submits out of a form. I even set my middle mouse button to "double-click", which is the fastest double-click you can get, and I dont get a chance to submit a form twice.
Let's just see... I will double-click when I post this entry and see if we get two entries: [sig][/sig]
As I thought; there are several possibilities here:
1. Double-clicking a submit button only works on older browsers, which I don't use anymore, or perhaps machines with much slower processors (486?)
2. You are using some other method than a standard submit button to submit your form.
3. Maybe this happens with <FORM METHOD="GET" which I havent' tested yet
4. Your form handler itself has a glitch.
5. Your form handler is actually the same page that submitted the form, without redirecting to a "Thank you" message, thus what is actually happening is people are actually reloading the form and the second click is hitting the refreshed page.
6. Or, the most likely possibility... people are refreshing the page that handles the form, thus processing the form request all over again. Most modern browsers warn you if you are resubmitting a form, but maybe some users ignore it, or their browser doesn't warn them. [sig][/sig]
rycamor,
This problem does exist. I've seen it many times. It's not always a refresh that causes this.
[sig]<p>nick bulka<br><a href=mailto: > </a><br><a href=
I take your answer with all respect. I'm not looking to cause a fight here. I'm just trying to understand exactly what IS happening. If possible, please give me a more detailed answer or better yet, specific HTML code where you have seen this happen, and with what browser/version, webserver, etc...
These things are important to me. No one has ever given me specifics on this. Notice above I suggest many possibilities, but you just focused on the refresh issue.
Rick,
Sorry if the tone of my post came across as confrontational. It wasn't meant to be. Sometimes I'm in such a hurry that I'm a bit too terse in my responses. I need to work on that. Please accept my apologies.
There are two instances where I see this type of thing hapening: the first is pretty predictable, especially when the submit results in a long query or some other lengthy server based operation. A user clicks the submit button, doesn't get a response right away, so he clicks the submit button again "just to make sure".
The other way this can happen is when the response from the server is very fast, as in an intranet where the systems are on the same network. This is where a double click can actually be seen as two clicks. In this case, the first submit actually makes it to the server, and the server starts processing it, then the request from the second click gets submitted, and the server processes that one too. I've had to write code to deal with this case, so I know it happens.
You're right, though that the newer browsers are a little more tolerant of the latter case.
hope this helps.
[sig]<p>nick bulka<br><a href=mailto: > </a><br><a href=
Thanks alot, Nick. Do you mind telling what webserver platforms you dealt with here?
My understanding had been that the newer browsers will even deal with the first problem you mention: Once the submit button is pressed, all further browser activity is halted until either the server responds, or the user cancels. Of course I suppose the user could cancel, and then hit the button again, while the server receives both requests. Am I wrong here?
I will keep trying to duplicate this, but have met with no success so far. [sig][/sig]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.