HighDots Forums  

Mutiple Form Submission

Website Design comp.infosystems.www.authoring.site-design


Discuss Mutiple Form Submission in the Website Design forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Robin Devany
 
Posts: n/a

Default Mutiple Form Submission - 02-09-2004 , 12:33 PM






Apologies if this is off-topic, but this seems as a good a place as any
to ask this (and I've never found a faq for this group).

When an HTML page contains a form and the client user presses a
submission button twice (or more), the page is sent twice (or more) to
the server. The server has to process all requests.

The problem is caused, usually, with the user becoming impatient or
doubtful with the first submission. The issue is how to process each
request properly, ignoring multiple submissions.

The only reliable mechanisim I can think of is to include a hidden
unique transaction code in the form, which the server can authenticate
when it receives it.

I'm aware that this technique has problems e.g. what response should
then second request get? Discard, Error, or the page generated by the
first response - this gets messy.

I'm interested in other strategies people have tried.

Any views?

(This is different from the submission refresh problem, which has a
different solution - redirection)

Thanks & regards

--

John Robin Devany


Reply With Quote
  #2  
Old   
kaeli
 
Posts: n/a

Default Re: Mutiple Form Submission - 02-10-2004 , 08:53 AM






In article <c08g9h$9te$1 (AT) titan (DOT) btinternet.com>, firstname (AT) lastname (DOT) com
enlightened us with...
Quote:
The problem is caused, usually, with the user becoming impatient or
doubtful with the first submission. The issue is how to process each
request properly, ignoring multiple submissions.

snip

I'm interested in other strategies people have tried.

Any views?

Well, I only code for intranet applications, so I know my users, their
browsers, and I know they have javascript enabled. Actually, the forms
won't submit without javascript (purposefully).
So, my solution is to, with javascript, disable the submission button
when it's clicked. This is used only for things like reports that take
time to run so my server isn't overloaded. Mutliple submissions would
not mess up my database - the application is designed to handle multiple
submissions with primary keys and checking on whether a key has been
entered, etc. If somehow the user was able to submit the form multiple
times, it wouldn't really hurt anything, data-wise - it would just
burden the server.

Another possible solution would be to set a variable to true when the
button is clicked and cancel form submission if it is clicked again.

Requiring javascript is NOT a feasible solution for most internet
applications, though.

As to how to handle the multiple submissions, I'd say it depends on what
the problem is. If a user clicks submit more than once, what happens
that you're trying to prevent? The real solution may be to re-code parts
of the application so it can handle that.

--
--
~kaeli~
Why do they sterilize the needles for lethal injections?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace



Reply With Quote
  #3  
Old   
John Robin Devany
 
Posts: n/a

Default Re: Mutiple Form Submission - 02-10-2004 , 11:18 AM



kaeli said the following on 10/02/2004 13:53:
Quote:
In article <c08g9h$9te$1 (AT) titan (DOT) btinternet.com>, firstname (AT) lastname (DOT) com
enlightened us with...

The problem is caused, usually, with the user becoming impatient or
doubtful with the first submission. The issue is how to process each
request properly, ignoring multiple submissions.


snip

I'm interested in other strategies people have tried.

Any views?



Well, I only code for intranet applications, so I know my users, their
browsers, and I know they have javascript enabled. Actually, the forms
won't submit without javascript (purposefully).

snipped stuff about howto with javascript)

As to how to handle the multiple submissions, I'd say it depends on what
the problem is. If a user clicks submit more than once, what happens
that you're trying to prevent? The real solution may be to re-code parts
of the application so it can handle that.

I don't consider Javascript to be an option. Though I do use Javascript
from time to time, I don't like it. Thanks for the idea though.

What I'm looking for is a generic solution, delegating the problem
architecturally.

Thanks & regards
--

John Robin Devany
http://www.devany.com



Reply With Quote
  #4  
Old   
John Robin Devany
 
Posts: n/a

Default Re: Mutiple Form Submission - 02-12-2004 , 07:51 AM



John Robin Devany said the following on 09/02/2004 17:33:
Quote:
Apologies if this is off-topic, but this seems as a good a place as any
to ask this (and I've never found a faq for this group).

When an HTML page contains a form and the client user presses a
submission button twice (or more), the page is sent twice (or more) to
the server. The server has to process all requests.

The problem is caused, usually, with the user becoming impatient or
doubtful with the first submission. The issue is how to process each
request properly, ignoring multiple submissions.

The only reliable mechanisim I can think of is to include a hidden
unique transaction code in the form, which the server can authenticate
when it receives it.

I'm aware that this technique has problems e.g. what response should
then second request get? Discard, Error, or the page generated by the
first response - this gets messy.

I'm interested in other strategies people have tried.

Any views?

(This is different from the submission refresh problem, which has a
different solution - redirection)

Thanks & regards

For the sake of good order, here's a link I found that has several ideas:

http://www.web-source.net/web_develo...submission.htm

--
John Robin Devany
http://www.devany.com



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.