onSubmit() is useful when you only have single submit button. But it does not work
multiple buttons with different behaviors.

To overcome onSubmit() or onClick() that already defines inline, one may use
register event method, like:

var old = (element.onclick) ? element.onclick : function () {};
element. () {old(); secondTimeWillReturnFalse()};
see

http://www.quirksmode.org/js/events_tradmod.html

for detail.


On 4/24/06, Johan Compagner <[EMAIL PROTECTED] > wrote:
hmm why do that in the onclick of a button
What i should do is just a method in the onSubmit of a form

secondTimeIWillReturnFalse()"

the problem is that we can't add that always to the onSubmit because it could already be defined.

johan



On 4/23/06, Ingram Chen <[EMAIL PROTECTED]> wrote:

the techniques we used is from:

http://willmaster.com/possibilities/archives/wmp20030805001.shtml


On 4/23/06, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:
Could you please provide the _javascript_. Thanks

Juergen

On 4/23/06, Ingram Chen <[EMAIL PROTECTED] > wrote:
> In our company we rely on _javascript_ to prevent pressing submit button
> twice.
> Besides prevent double submit, the _javascript_ also disable all other
> available buttons
> in the page. This shields the user accidently break first request.
>
> _javascript_ is not perfect, but quite useful in many situations. It would be
> great if
> we can add a feature in Form like form.setProtectSubmit(true) and generate
> necessary scripts.
>
>
>
>
> On 4/23/06, Martijn Dashorst < [EMAIL PROTECTED]> wrote:
> >
> > All,
> >
> > I have been contemplating this for a while, having it work in the
> background of my head. I think we might still have a problem with double
> submits.
> >
> > First of all, we have solved the problem of the backbutton that does
> perform a post request. That is not a problem anymore, and IMO solved
> elegantly.
> >
> > What is still a problem though is that when the submit of a form takes a
> while, or when the user advertently presses the submit button twice (the
> famous double click), wicket will still process the request twice.
> >
> > Is this a Wicket framework concern or is it a application developer
> problem? Or is this something we might be able to check and prevent in a
> configurable manner? Something along the lines of a SingleSubmitForm extends
> Form in wicket-extensions that prevents this out of the box if possible at
> all?
> >
> > Martijn
> >
> >
> > --
> > Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!
> > -- http://wicketframework.org
>
>
>
>
> --
> Ingram Chen
> Java [EMAIL PROTECTED]
> Institue of BioMedical Sciences Academia Sinica Taiwan
> blog: http://www.javaworld.com.tw/roller/page/ingramchen


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop



--

Ingram Chen
Java [EMAIL PROTECTED]
Institue of BioMedical Sciences Academia Sinica Taiwan
blog: http://www.javaworld.com.tw/roller/page/ingramchen




--
Ingram Chen
Java [EMAIL PROTECTED]
Institue of BioMedical Sciences Academia Sinica Taiwan
blog: http://www.javaworld.com.tw/roller/page/ingramchen

Reply via email to