You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by lucas owen <sr...@gmail.com> on 2012/06/19 10:58:20 UTC

validation method is being executed twice in IE (jCaptcha img)

Hi Struts 2 Users!

I have this little problem here, only in Internet Explorer (it works in
Firefox and Chrome):

the action is being executed twice I think because in the JSP form I have a
captcha with an image and when it fetches the image it creates a new
request.

Anybody knows how to solve it?

thanks in advance!!

Re: validation method is being executed twice in IE (jCaptcha img)

Posted by Dave Newton <da...@gmail.com>.
You need to stop the default click handling; returning a false value from
the onclick attribute may be enough.

Dave

(pardon brevity and typos, on cell)
On Jun 19, 2012 5:14 AM, "lucas owen" <sr...@gmail.com> wrote:

> Sorry I got wrong idea.
>
> The problem is that I submit the form via javascript, that's why it's being
> executed twice!!
>
> <s:submit cssClass="button_02" onclick="javascript:search();"
> value="Send"/>
>
> <script type="text/javascript">
> function search(value){
> document.getElementById('index').value=0;
> document.forms['formRER'].action="searchRER.action";
> document.forms['formRER'].submit();
> }
> function navigate(value){
> document.getElementById('index').value=value;
> document.forms['formRER'].action="searchRER.action";
> document.forms['formRER'].submit();
> }
> </script>
>
> but I cant avoid JS, as I'm paginating the results and I need to submit the
> index...
>
> 2012/6/19 Maurizio Cucchiara <mc...@apache.org>
>
> > Hi Lucas,
> >
> > we need some more further details...
> > What S2 stack did you define for you action? Why do you suspect that your
> > action is executed twice?
> > Could you post the java and jsp fragments?
> >
> > Twitter     :http://www.twitter.com/m_cucchiara
> > G+          :https://plus.google.com/107903711540963855921
> > Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
> >
> > Maurizio Cucchiara
> >
> >
> > On 19 June 2012 10:58, lucas owen <sr...@gmail.com> wrote:
> >
> > > Hi Struts 2 Users!
> > >
> > > I have this little problem here, only in Internet Explorer (it works in
> > > Firefox and Chrome):
> > >
> > > the action is being executed twice I think because in the JSP form I
> > have a
> > > captcha with an image and when it fetches the image it creates a new
> > > request.
> > >
> > > Anybody knows how to solve it?
> > >
> > > thanks in advance!!
> > >
> >
>

Re: client validation isn't generated when using a VisitorFieldValidator annotation

Posted by Dave Newton <da...@gmail.com>.
On Tue, Jun 19, 2012 at 12:58 PM, Shrinivas Parashar <
Shrinivas_Parashar@symantec.com> wrote:

> I am using visitorFieldValidator in my action class. Server Side
> validation is working fine. But the problem is client side validation code
> is not generated.
>
> One more problem with client side validation seen is the order of
> validation code generated is different than the expected. (If I move
> complete validation to action class)
>

AFAIK not all validation models are supported on the client side, as per
[1].

Note particularly the blue (i) icon that states:

> JavaScript client validation is not available for visitor validations

Dave

[1]
http://struts.apache.org/2.3.1.2/docs/pure-javascript-client-side-validation.html

client validation isn't generated when using a VisitorFieldValidator annotation

Posted by Shrinivas Parashar <Sh...@symantec.com>.
Hi,
I am using visitorFieldValidator in my action class. Server Side validation is working fine. But the problem is client side validation code is not generated.

One more problem with client side validation seen is the order of validation code generated is different than the expected. (If I move complete validation to action class)

I am using Struts 2.3.1.2 version.

Regards,
Shrinivas

Re: validation method is being executed twice in IE (jCaptcha img)

Posted by lucas owen <sr...@gmail.com>.
yes my friends!!

that was the problem, impossible to figure out for me, as it worked in
firefox and chrome and i thought that it was a IE bug

so many thanks!!!

2012/6/19 Łukasz Lenart <lu...@googlemail.com>

> 2012/6/19 lucas owen <sr...@gmail.com>:
> > Sorry I got wrong idea.
> >
> > The problem is that I submit the form via javascript, that's why it's
> being
> > executed twice!!
> >
> > <s:submit cssClass="button_02" onclick="javascript:search();"
> value="Send"/>
>
> did you try to add return false ?
>
>
> REgards
> --
> Łukasz
> mobile +48 606 323 122 http://www.lenart.org.pl/
> Warszawa JUG conference - Confitura http://confitura.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: validation method is being executed twice in IE (jCaptcha img)

Posted by Łukasz Lenart <lu...@googlemail.com>.
2012/6/19 lucas owen <sr...@gmail.com>:
> Sorry I got wrong idea.
>
> The problem is that I submit the form via javascript, that's why it's being
> executed twice!!
>
> <s:submit cssClass="button_02" onclick="javascript:search();" value="Send"/>

did you try to add return false ?


REgards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: validation method is being executed twice in IE (jCaptcha img)

Posted by lucas owen <sr...@gmail.com>.
Sorry I got wrong idea.

The problem is that I submit the form via javascript, that's why it's being
executed twice!!

<s:submit cssClass="button_02" onclick="javascript:search();" value="Send"/>

<script type="text/javascript">
function search(value){
document.getElementById('index').value=0;
document.forms['formRER'].action="searchRER.action";
document.forms['formRER'].submit();
}
function navigate(value){
document.getElementById('index').value=value;
document.forms['formRER'].action="searchRER.action";
document.forms['formRER'].submit();
}
</script>

but I cant avoid JS, as I'm paginating the results and I need to submit the
index...

2012/6/19 Maurizio Cucchiara <mc...@apache.org>

> Hi Lucas,
>
> we need some more further details...
> What S2 stack did you define for you action? Why do you suspect that your
> action is executed twice?
> Could you post the java and jsp fragments?
>
> Twitter     :http://www.twitter.com/m_cucchiara
> G+          :https://plus.google.com/107903711540963855921
> Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
>
> Maurizio Cucchiara
>
>
> On 19 June 2012 10:58, lucas owen <sr...@gmail.com> wrote:
>
> > Hi Struts 2 Users!
> >
> > I have this little problem here, only in Internet Explorer (it works in
> > Firefox and Chrome):
> >
> > the action is being executed twice I think because in the JSP form I
> have a
> > captcha with an image and when it fetches the image it creates a new
> > request.
> >
> > Anybody knows how to solve it?
> >
> > thanks in advance!!
> >
>

Re: validation method is being executed twice in IE (jCaptcha img)

Posted by Maurizio Cucchiara <mc...@apache.org>.
Hi Lucas,

we need some more further details...
What S2 stack did you define for you action? Why do you suspect that your
action is executed twice?
Could you post the java and jsp fragments?

Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara


On 19 June 2012 10:58, lucas owen <sr...@gmail.com> wrote:

> Hi Struts 2 Users!
>
> I have this little problem here, only in Internet Explorer (it works in
> Firefox and Chrome):
>
> the action is being executed twice I think because in the JSP form I have a
> captcha with an image and when it fetches the image it creates a new
> request.
>
> Anybody knows how to solve it?
>
> thanks in advance!!
>

Re: validation method is being executed twice in IE (jCaptcha img)

Posted by Dave Newton <da...@gmail.com>.
How is it fetching the image? That shouldn't cause a request to the action.

Dave

(pardon brevity and typos, on cell)
On Jun 19, 2012 4:58 AM, "lucas owen" <sr...@gmail.com> wrote:

> Hi Struts 2 Users!
>
> I have this little problem here, only in Internet Explorer (it works in
> Firefox and Chrome):
>
> the action is being executed twice I think because in the JSP form I have a
> captcha with an image and when it fetches the image it creates a new
> request.
>
> Anybody knows how to solve it?
>
> thanks in advance!!
>