You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Frank McLean <fm...@sentrylink.com> on 2006/12/14 17:52:47 UTC
TC 5.5.15 - Internet Explorer firing multiple form submits?
Hi,
We use TC 5.5.15 behind an Apache2 front end and the AJP connecter.
I have a form, using the SSLEXT tag library-
<ssl:form action="/myaction.do">
- which posts to Struts and thence to my app.
I have a couple of submit buttons similar to the following:
<html:submit value='Update stuff'
onclick='mode.value=2;document.forms[0].submit()'/>
Everything is well in FireFox, but not in Internet Explorer 6 (have not
tested previous IE's). In IE6, I am frequently and reproducibly getting
multiple (max 3, it looks like) identical requests logged in both the
Apache SSL log and the TC data_access.log whenever the submit button is
pressed. It's a database maintenance page, so I am simply hitting
update once every few seconds, without changing any of the displayed values.
I have tried to look at the traffic from my PC in Ethereal, but it's
encrypted, of course, so I'm not sure I'm reading things right. I could
take out the SSLEXT tag, but that would be changing the submission
process too much, for my liking.
So... My question is, has anyone ever worked this one out? I see posts
back from 2003, but they peter out pretty much after someone suggests
blocking the possibility of double-clicking the button (not the problem).
I can build in lots of annoying checks, and may have to, but I am
insanely keen to know why I have to do that before proceeding.
Thanks in advance, fingers crossed.
Frank
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: TC 5.5.15 - Internet Explorer firing multiple form submits?
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Frank,
Frank McLean wrote:
> I have a couple of submit buttons similar to the following:
>
> <html:submit value='Update stuff'
> onclick='mode.value=2;document.forms[0].submit()'/>
Your javascript is causing the "multiple submit" behavior. You need to
change your onclick handler to this:
onclick="mod.value=2; document.forms[0].submit(); return false;"
If you don't have the "return false" at the end, then the default action
is still performed (which, for a SUBMIT button is to submit the form).
So, you have one form submission coming from your javascript trigger,
and another that the browser is performing because you didn't tell it
not to do so.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFgYQd9CaO5/Lv0PARAnTMAJ9Wyng82bTPmmwxf0X+Pt3wnM5+2QCcDDk4
VhnqR0cEZZI2B1z3girjzdk=
=YOwr
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org