You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Juanjo Cuadrado <jj...@gmail.com> on 2008/02/24 18:24:19 UTC

Re: how to avoid form's validation if the user choose cancel?

And in the version 1.x?

2008/1/3, xianwinwin <xi...@gmail.com>:
>
>
> YES! exactly what I needed. thanks!!!
>
>
>
>
>
> Alberto A. Flores wrote:
> >
> > one way I did that was by using the "non-validating" method point to a
> > method (in the Action class) to have the following annotation
> >
> > @SkipValidation
> >
> > Then in the struts tag, you force the button to use such method (method
> > attribute in tag).
> >
> > Good luck!
> >
> > xianwinwin wrote:
> >> I have a login form. it has 3 buttons:
> >>
> >> 1. login
> >> 2. register
> >> 3. cancel
> >>
> >> when the user clicks the login - the application validates that the
> user
> >> input data on the 'username' and 'password' fields.
> >>
> >> Question: how can I avoid this validation if the user clicks either
> >> 'register' or 'cancel'
> >>
> >> I'm using struts2:
> >>
> >> this is the code:
> >>
> >> <s:form action="UserLogin" validate="true">
> >>     <s:textfield key="username" />
> >>     <s:password key="password" showPassword="true"/>
> >>     <!-- <s:textfield key="now" /> -->
> >>
> >>     <s:submit action="UserLogin_login" key="button.login" />
> >>     <s:submit action="UserLogin_register" key="button.confirm"
> >> onclick="form.onsubmit=null"/>
> >>     <s:submit action="UserLogin_cancel" key="button.cancel"
> >> onclick="form.onsubmit=null"/>
> >>
> >> </s:form>
> >> thanks
> >
> > --
> >
> > Alberto A. Flores
> > http://www.linkedin.com/in/aflores
> >
> >
> >
>
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
>
> --
> View this message in context:
> http://www.nabble.com/how-to-avoid-form%27s-validation-if-the-user-choose-cancel--tp14582809p14604337.html
>
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>