You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Benny Law <be...@gmail.com> on 2009/09/23 23:07:34 UTC

Preventing Form Resubmission

I was wondering if Tapestry automatically prevents a form from being
submitted more than once (like when you press the Enter key quickly a few
times when you are in a text field)? In my quick test, it seemed that
something was providing this protection. I have some JavaScript that will
provide this safeguard (which I used in another non-Tapestry application),
but I would like to confirm if it will be needed.

Thanks in advance.

Benny

Re: Preventing Form Resubmission

Posted by Benny Law <be...@gmail.com>.
This is a very informative article. Thanks for sharing, Sebastian.

Benny

On Thu, Sep 24, 2009 at 7:32 AM, Sebastian Hennebrueder
<us...@laliluna.de>wrote:

> Hello,
>
> I described an approach without using Javascript.
>
> http://www.laliluna.de/tapestry-webframework-evaluation-test.html
>
> Best Regards
>
> Sebastian
>
> Benny Law schrieb:
>
>  Thanks Geoff. I can't access this link for some reason, but I'll try again
>> later.
>> Here is my JavaScript (feel free to critique):
>>
>> document.observe("dom:loaded", function() {
>>    $$("form").invoke("observe", "submit", function(event) {
>>        if (this.submitted) {
>>            event.stop();
>>        } else {
>>            this.submitted = true;
>>        };
>>    });
>> });
>>
>> Benny
>>
>> On Wed, Sep 23, 2009 at 6:09 PM, Geoff Callender <
>> geoff.callender.jumpstart@gmail.com> wrote:
>>
>>  Tapestry doesn't. Here's a solution that uses a mixin. The mixin's
>>> JavaScript might be similar to yours.
>>>
>>>
>>>
>>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/javascript/creatingmixins1
>>>
>>> Cheers,
>>>
>>> Geoff
>>>
>>>
>>> On 24/09/2009, at 7:34 AM, Thiago H. de Paula Figueiredo wrote:
>>>
>>>  Em Wed, 23 Sep 2009 18:07:34 -0300, Benny Law <be...@gmail.com>
>>>
>>>> escreveu:
>>>>
>>>>  I was wondering if Tapestry automatically prevents a form from being
>>>>
>>>>> submitted more than once (like when you press the Enter key quickly a
>>>>> few
>>>>> times when you are in a text field)? In my quick test, it seemed that
>>>>> something was providing this protection. I have some JavaScript that
>>>>> will
>>>>> provide this safeguard (which I used in another non-Tapestry
>>>>> application),
>>>>>
>>>>>  I don't think so, but I'm not 100% sure.
>>>>
>>>> --
>>>> Thiago H. de Paula Figueiredo
>>>> Independent Java consultant, developer, and instructor
>>>> http://www.arsmachina.com.br/thiago
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>  ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
>
>
> --
> Best Regards / Viele Grüße
>
> Sebastian Hennebrueder
> -----
> Software Developer and Trainer for Hibernate / Java Persistence
> http://www.laliluna.de
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Preventing Form Resubmission

Posted by Sebastian Hennebrueder <us...@laliluna.de>.
Hello,

I described an approach without using Javascript.

http://www.laliluna.de/tapestry-webframework-evaluation-test.html

Best Regards

Sebastian

Benny Law schrieb:
> Thanks Geoff. I can't access this link for some reason, but I'll try again
> later.
> Here is my JavaScript (feel free to critique):
> 
> document.observe("dom:loaded", function() {
>     $$("form").invoke("observe", "submit", function(event) {
>         if (this.submitted) {
>             event.stop();
>         } else {
>             this.submitted = true;
>         };
>     });
> });
> 
> Benny
> 
> On Wed, Sep 23, 2009 at 6:09 PM, Geoff Callender <
> geoff.callender.jumpstart@gmail.com> wrote:
> 
>> Tapestry doesn't. Here's a solution that uses a mixin. The mixin's
>> JavaScript might be similar to yours.
>>
>>
>> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/javascript/creatingmixins1
>>
>> Cheers,
>>
>> Geoff
>>
>>
>> On 24/09/2009, at 7:34 AM, Thiago H. de Paula Figueiredo wrote:
>>
>>  Em Wed, 23 Sep 2009 18:07:34 -0300, Benny Law <be...@gmail.com>
>>> escreveu:
>>>
>>>  I was wondering if Tapestry automatically prevents a form from being
>>>> submitted more than once (like when you press the Enter key quickly a few
>>>> times when you are in a text field)? In my quick test, it seemed that
>>>> something was providing this protection. I have some JavaScript that will
>>>> provide this safeguard (which I used in another non-Tapestry
>>>> application),
>>>>
>>> I don't think so, but I'm not 100% sure.
>>>
>>> --
>>> Thiago H. de Paula Figueiredo
>>> Independent Java consultant, developer, and instructor
>>> http://www.arsmachina.com.br/thiago
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 



-- 
Best Regards / Viele Grüße

Sebastian Hennebrueder
-----
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de



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


Re: Preventing Form Resubmission

Posted by Benny Law <be...@gmail.com>.
Thanks Geoff. I can't access this link for some reason, but I'll try again
later.
Here is my JavaScript (feel free to critique):

document.observe("dom:loaded", function() {
    $$("form").invoke("observe", "submit", function(event) {
        if (this.submitted) {
            event.stop();
        } else {
            this.submitted = true;
        };
    });
});

Benny

On Wed, Sep 23, 2009 at 6:09 PM, Geoff Callender <
geoff.callender.jumpstart@gmail.com> wrote:

> Tapestry doesn't. Here's a solution that uses a mixin. The mixin's
> JavaScript might be similar to yours.
>
>
> http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/javascript/creatingmixins1
>
> Cheers,
>
> Geoff
>
>
> On 24/09/2009, at 7:34 AM, Thiago H. de Paula Figueiredo wrote:
>
>  Em Wed, 23 Sep 2009 18:07:34 -0300, Benny Law <be...@gmail.com>
>> escreveu:
>>
>>  I was wondering if Tapestry automatically prevents a form from being
>>> submitted more than once (like when you press the Enter key quickly a few
>>> times when you are in a text field)? In my quick test, it seemed that
>>> something was providing this protection. I have some JavaScript that will
>>> provide this safeguard (which I used in another non-Tapestry
>>> application),
>>>
>>
>> I don't think so, but I'm not 100% sure.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java consultant, developer, and instructor
>> http://www.arsmachina.com.br/thiago
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Preventing Form Resubmission

Posted by Geoff Callender <ge...@gmail.com>.
Tapestry doesn't. Here's a solution that uses a mixin. The mixin's  
JavaScript might be similar to yours.

	http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/javascript/creatingmixins1

Cheers,

Geoff

On 24/09/2009, at 7:34 AM, Thiago H. de Paula Figueiredo wrote:

> Em Wed, 23 Sep 2009 18:07:34 -0300, Benny Law  
> <be...@gmail.com> escreveu:
>
>> I was wondering if Tapestry automatically prevents a form from being
>> submitted more than once (like when you press the Enter key quickly  
>> a few
>> times when you are in a text field)? In my quick test, it seemed that
>> something was providing this protection. I have some JavaScript  
>> that will
>> provide this safeguard (which I used in another non-Tapestry  
>> application),
>
> I don't think so, but I'm not 100% sure.
>
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


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


Re: Preventing Form Resubmission

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Wed, 23 Sep 2009 18:07:34 -0300, Benny Law <be...@gmail.com>  
escreveu:

> I was wondering if Tapestry automatically prevents a form from being
> submitted more than once (like when you press the Enter key quickly a few
> times when you are in a text field)? In my quick test, it seemed that
> something was providing this protection. I have some JavaScript that will
> provide this safeguard (which I used in another non-Tapestry  
> application),

I don't think so, but I'm not 100% sure.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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