tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: multiple form submits
Date Thu, 20 May 2010 14:01:44 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pid,

On 5/17/2010 4:43 PM, Pid wrote:
> On 17/05/2010 21:07, Christopher Schultz wrote:
>> Karthik,
>>
>> On 5/13/2010 3:45 AM, Karthik Nanjangude wrote:
>>> Question  :     My web application uses "href" & "css based image's"
>>> for  transferring the request from 1 page to another The problem is
>>> UserVisitor is  clicking the image based href  MULTIPLE TIMES (
>>> multiple clicks )
>>
>> Ok.
>>
>>> <a href="image.jsp?mult=1" id='submitButton1'
>>>    onClick="this.onclick=function(){return false}" target="_self"
>>>    class="buttonRedSmall"><span>Submit Form</span></a></td>
>>
>> That's a nasty construct: when the user clicks the link, you change the
>> onClick handler? How about this:
>>
>> <a href="image.jsp?mult=1" id='submitButton1'
>>    onclick="return false;"
>>    class="buttonRedSmall"><span>Submit Form</span></a>
> 
> The goal of the original code is to change the onclick handler such that
> on the *second* click, the handler returns false and so stops the
> action, theoretically preventing the multiple click stream problem.

That's fine, but the onclick handler doesn't do anything but disable
itself upon the first click. Perhaps this is a toy example and not the
real thing. Again, this link does not submit a form in the first place
unless a lot of information has been removed.

I've toyed with things like this (mostly by disabling form submit
buttons) but I've always been worried that something will interrupt the
submission process itself, leaving a user with a form that will never
submit again. :(

I'd love to hear some clever solutions to this problem. I started
writing a javascript function that would disable the submit button, then
schedule it to be re-enabled in, say, 30 seconds, but it was a bit fragile.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkv1QMgACgkQ9CaO5/Lv0PA15wCgrqJhjo2w+xlcuYZwxnLX7/1l
GLQAoKd31cKOBb99T2TxlZK2PRyil07a
=xhnm
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message