You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by zeta <zo...@gmail.com> on 2006/10/25 13:31:54 UTC

Validation with actions

I want to associate the validation with the action definition. In this way, I
need to performed the client-side validation when an action is called and
not taken into account the form associated to this action. Can you give me
some example of how do this?

Thanks!

Zeta

-- 
View this message in context: http://www.nabble.com/Validation-with-actions-tf2507074.html#a6990299
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


Re: Validation with actions

Posted by Chris Pratt <th...@gmail.com>.
Ummm... If you don't call <html:javascript/> there won't be any client side
validation code inserted, so there won't be any client side validation
performed, IIRC.
  (*Chris*)

On 10/26/06, zeta <zo...@gmail.com> wrote:
>
>
> Ok, sorry. If I use DynaValidationActionForm instead of DynaValidationForm
> for creating my forms, what should I do in order to disable form
> validation
> in both sides: client (javascript) and server? I know how to bypass server
> validation (using validate=false in the action tag) but I haven't been
> able
> to do the same in client side.
>
> Thanks,
>
> Zeta.-
>
> Laurie Harper wrote:
> >
> > zeta wrote:
> >> I want to associate the validation with the action definition. In this
> >> way, I
> >> need to performed the client-side validation when an action is called
> and
> >> not taken into account the form associated to this action. Can you give
> >> me
> >> some example of how do this?
> >
> > I'm not sure what you mean by 'not taken into account the form
> > associated to this action.' The way to get client-side validation is to
> > include the <html:javascript> tag somewhere inside your <html:form>, and
> >   add an onsubmit handler to the form to call the generated Javascript
> > code. See the <html:javascript> documentation [1] and the Validator
> > Guide [2] for more info.
> >
> > L.
> >
> > [1]
> > http://struts.apache.org/1.3.5/struts-taglib/tlddoc/html/javascript.html
> >
> > [2] http://struts.apache.org/1.3.5/faqs/validator.html
> >
> >
> > ---------------------------------------------------------------------
> > 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/Validation-with-actions-tf2507074.html#a7008710
> 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
>
>

Re: Validation with actions

Posted by zeta <zo...@gmail.com>.
Ok, sorry. If I use DynaValidationActionForm instead of DynaValidationForm
for creating my forms, what should I do in order to disable form validation
in both sides: client (javascript) and server? I know how to bypass server
validation (using validate=false in the action tag) but I haven't been able
to do the same in client side.

Thanks,

Zeta.-

Laurie Harper wrote:
> 
> zeta wrote:
>> I want to associate the validation with the action definition. In this
>> way, I
>> need to performed the client-side validation when an action is called and
>> not taken into account the form associated to this action. Can you give
>> me
>> some example of how do this?
> 
> I'm not sure what you mean by 'not taken into account the form 
> associated to this action.' The way to get client-side validation is to 
> include the <html:javascript> tag somewhere inside your <html:form>, and 
>   add an onsubmit handler to the form to call the generated Javascript 
> code. See the <html:javascript> documentation [1] and the Validator 
> Guide [2] for more info.
> 
> L.
> 
> [1]
> http://struts.apache.org/1.3.5/struts-taglib/tlddoc/html/javascript.html
> 
> [2] http://struts.apache.org/1.3.5/faqs/validator.html
> 
> 
> ---------------------------------------------------------------------
> 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/Validation-with-actions-tf2507074.html#a7008710
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


Re: Validation with actions

Posted by Laurie Harper <la...@holoweb.net>.
zeta wrote:
> I want to associate the validation with the action definition. In this way, I
> need to performed the client-side validation when an action is called and
> not taken into account the form associated to this action. Can you give me
> some example of how do this?

I'm not sure what you mean by 'not taken into account the form 
associated to this action.' The way to get client-side validation is to 
include the <html:javascript> tag somewhere inside your <html:form>, and 
  add an onsubmit handler to the form to call the generated Javascript 
code. See the <html:javascript> documentation [1] and the Validator 
Guide [2] for more info.

L.

[1] http://struts.apache.org/1.3.5/struts-taglib/tlddoc/html/javascript.html

[2] http://struts.apache.org/1.3.5/faqs/validator.html


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