You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Christopher Campbell <ch...@campbellvision.com> on 2002/01/20 22:38:17 UTC

Action called twice with javascript doSubmit call

Hello,

I'm using an image button and the javascript 
document.<formname>.doSubmit() call to
submit a form.

I've added the action via input type hidden as well as the following entry,
<input type="hidden" name="eventSubmit_doDelete" value="submit">
so that the right do-method is called in my action class.

It works, however, the action and the screen classes envolved in the request
are called twice.
Things work correctly (action executed only once) if i use the regular 
<input type="submit" ...>
form entry.

Does anyone know why this is so ?

I'm using Turbine2.2b1 latest cvs build.

Thanks in advance,

Christopher



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Action called twice with javascript doSubmit call

Posted by Christopher Campbell <ch...@campbellvision.com>.
Thanks for your response guys,

I'm not quite sure I understand what is meant with the redirect to an empty
string. Both action and screen classes recieve the correct parameters 
which leads
in some cases to the same data being submitted to the database.
It's a strange problem. I also tried just submiting the hidden action value
and using a class with only the doPerform method defined but, I still 
get the same
problem.
In any case for now I'll just not use javascript since things work that way.

cheers,
Christopher

Martin van den Bemt wrote:

>It could also be that you are redirecting to an empty string, which causes a
>redirect to the current page, without any parameters (which can be very
>confusing I must add).
>
>Mvgr,
>Martin
>
>>-----Original Message-----
>>From: jmcnally [mailto:jmcnally]On Behalf Of John McNally
>>Sent: Monday, January 21, 2002 09:06
>>To: Turbine Users List
>>Subject: Re: Action called twice with javascript doSubmit call
>>
>>
>>You say the screen and action is executed twice.  This leads me to
>>believe the form is being submitted twice.  I had a problem like this
>>once when i had a javascript submit based on tabbing out of a field with
>>the possibility of pressing a normal submit button as well.  Pressing
>>the submit button would lead to two requests being made.
>>
>>Your situation does not sound exactly the same, but the symptoms are
>>similar.  Unfortunately I do not have any fix as I just dropped the
>>javascript.
>>
>>john mcnally
>>
>>Christopher Campbell wrote:
>>
>>>Hello,
>>>
>>>I'm using an image button and the javascript
>>>document.<formname>.doSubmit() call to
>>>submit a form.
>>>
>>>I've added the action via input type hidden as well as the
>>>
>>following entry,
>>
>>><input type="hidden" name="eventSubmit_doDelete" value="submit">
>>>so that the right do-method is called in my action class.
>>>
>>>It works, however, the action and the screen classes envolved
>>>
>>in the request
>>
>>>are called twice.
>>>Things work correctly (action executed only once) if i use the regular
>>><input type="submit" ...>
>>>form entry.
>>>
>>>Does anyone know why this is so ?
>>>
>>>I'm using Turbine2.2b1 latest cvs build.
>>>
>>>Thanks in advance,
>>>
>>>Christopher
>>>
>>>--
>>>To unsubscribe, e-mail:
>>>
><ma...@jakarta.apache.org>
>
>>For additional commands, e-mail:
>>
><ma...@jakarta.apache.org>
>
>--
>To unsubscribe, e-mail:
><ma...@jakarta.apache.org>
>For additional commands, e-mail:
><ma...@jakarta.apache.org>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Action called twice with javascript doSubmit call

Posted by Martin van den Bemt <ma...@isallineed.org>.
It could also be that you are redirecting to an empty string, which causes a
redirect to the current page, without any parameters (which can be very
confusing I must add).

Mvgr,
Martin

> -----Original Message-----
> From: jmcnally [mailto:jmcnally]On Behalf Of John McNally
> Sent: Monday, January 21, 2002 09:06
> To: Turbine Users List
> Subject: Re: Action called twice with javascript doSubmit call
>
>
> You say the screen and action is executed twice.  This leads me to
> believe the form is being submitted twice.  I had a problem like this
> once when i had a javascript submit based on tabbing out of a field with
> the possibility of pressing a normal submit button as well.  Pressing
> the submit button would lead to two requests being made.
>
> Your situation does not sound exactly the same, but the symptoms are
> similar.  Unfortunately I do not have any fix as I just dropped the
> javascript.
>
> john mcnally
>
> Christopher Campbell wrote:
> >
> > Hello,
> >
> > I'm using an image button and the javascript
> > document.<formname>.doSubmit() call to
> > submit a form.
> >
> > I've added the action via input type hidden as well as the
> following entry,
> > <input type="hidden" name="eventSubmit_doDelete" value="submit">
> > so that the right do-method is called in my action class.
> >
> > It works, however, the action and the screen classes envolved
> in the request
> > are called twice.
> > Things work correctly (action executed only once) if i use the regular
> > <input type="submit" ...>
> > form entry.
> >
> > Does anyone know why this is so ?
> >
> > I'm using Turbine2.2b1 latest cvs build.
> >
> > Thanks in advance,
> >
> > Christopher
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Action called twice with javascript doSubmit call

Posted by John McNally <jm...@collab.net>.
You say the screen and action is executed twice.  This leads me to
believe the form is being submitted twice.  I had a problem like this
once when i had a javascript submit based on tabbing out of a field with
the possibility of pressing a normal submit button as well.  Pressing
the submit button would lead to two requests being made.

Your situation does not sound exactly the same, but the symptoms are
similar.  Unfortunately I do not have any fix as I just dropped the
javascript.  

john mcnally

Christopher Campbell wrote:
> 
> Hello,
> 
> I'm using an image button and the javascript
> document.<formname>.doSubmit() call to
> submit a form.
> 
> I've added the action via input type hidden as well as the following entry,
> <input type="hidden" name="eventSubmit_doDelete" value="submit">
> so that the right do-method is called in my action class.
> 
> It works, however, the action and the screen classes envolved in the request
> are called twice.
> Things work correctly (action executed only once) if i use the regular
> <input type="submit" ...>
> form entry.
> 
> Does anyone know why this is so ?
> 
> I'm using Turbine2.2b1 latest cvs build.
> 
> Thanks in advance,
> 
> Christopher
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>