You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Peter Onthrops <po...@yahoo.com> on 2002/09/14 02:20:12 UTC

validator configuration question

When you configure a validator method in validator-rules.xml, you assign a classname and method for server side validation and then add a javascript tag for client side validation.

Will the validator always call the server side method? I only want to validate using the javascript code. What seems to be happening is that the javascript validation occurs and then the server side validation also occurs. So validation is happening twice - not very efficient.

Is there a way to configure the validator to only validate with the javascript code? Or will I have to change the validator method to be a default method that just returns true because the real validation is handled on the client side. 

Petra



---------------------------------
Do you Yahoo!?
Yahoo! News - Today's headlines

Re: validator configuration question

Posted by Eddie Bush <ek...@swbell.net>.
Peter Onthrops wrote:

>When you configure a validator method in validator-rules.xml, you assign a classname and method for server side validation and then add a javascript tag for client side validation.
>
>Will the validator always call the server side method? I only want to validate using the javascript code. What seems to be happening is that the javascript validation occurs and then the server side validation also occurs. So validation is happening twice - not very efficient.
>
... I for one am quite pleased that it does this.  Do you have no 
visitors that disable javascript?  I bet you do!  Turn off that 
server-side validation and find out!  ;-)

>Is there a way to configure the validator to only validate with the javascript code? Or will I have to change the validator method to be a default method that just returns true because the real validation is handled on the client side. 
>
Yep.  I wouldn't do it, but I think that's the only way you could.

>Petra
>
Regards,

Eddie



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