You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Seyhan BASMACI (Internet Yazilimlari Yetkilisi)" <sb...@teb.com.tr> on 2004/03/25 09:23:26 UTC

is it possible to define a validation that runs only server side or client side (validation.xml )

I have a LoginForm form extends ValidatorForm and I want to decide 
a validaton runs only on the server or client side, (or both )
is there any way to do this_? 

 <form name="LoginForm">
      <field property="userno" depends="required">
        <arg0 key="caption.wusernono"/>
      </field>
 </form> 

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


Re: is it possible to define a validation that runs only server side or client side (validation.xml )

Posted by ruben <ru...@yahoo.es>.
Seyhan BASMACI (Internet Yazilimlari Yetkilisi) wrote:

>I have a LoginForm form extends ValidatorForm and I want to decide 
>a validaton runs only on the server or client side, (or both )
>is there any way to do this_? 
>
> <form name="LoginForm">
>      <field property="userno" depends="required">
>        <arg0 key="caption.wusernono"/>
>      </field>
> </form> 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>  
>
hi,
if you want to call th javascript validation you only have to call the 
function
validateLoginForm(form); if you don't call this function, client side 
validation is not called.
the case of server side validation is more complex, if you only want to 
call the client side validation and not the server side, you have to 
overwrite the method validate of the ActionForm, and do nothing on it, 
returning null.


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