We're working in .net MVC and have a form to submit an email request. A user was on a very unstable internet connection (on an airplane) and claims that despite clicking the send button once, the form posted 6 times, resulting in 6 emails being sent. I've been looking around, but have not been able to find a way to explain that behavior. Is there any way for a posted form to submit multiple times due to a spotty connection?
2 Answers
That would really depend on the actual browser, but I have yet to see one doing something like that (in fact, doing so would be dangerous, e.g. in the context of some online ordering service for example).
However, such things can happen by accident rather easily. Sometimes people aren't aware of multiple clicks, because they don't notice a first click triggering anything. It might happen that a browser doesn't immediately show any loading action/activity, especially with unstable connections. Also it's possible that due to some hardware problem (broken mouse button) multiple clicks are executed, despite only clicking once.
Just to be sure, I'd simply add some minimal JavaScript code to the form: On submit, disable the submit button and also avoid further attempts to send the form (intercept the onsubmit
event and return true
the first time; from there on always return false
).

- 35,726
- 5
- 62
- 78
-
Thank you for the insight. They were on Chrome. And we have definitely put client and server-side protections in since; I just wanted to make sure I know the full picture. – cdutcher Jul 23 '13 at 21:24
I know I am late to answer but I faced similar problem and I believe the issue is with the browser. We use AJAX to submit form data to the controller and the processing takes a lot of time as the data to be processed is huge. Browsers like Chrome, wait for a certain time and if they do not receive a response, assume request is lost and send another request on it's own which is quite possibly the case on your end.Note that the same issue does not happen in browsers like Firefox and IE.
What we did to avoid that situation is to get the method work asynchronously and have the response back to the AJAX method within that interval of time to avoid Chrome from issuing a request again.
This link explains in detail the same issue.

- 1,875
- 2
- 24
- 42