You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rajesh <ra...@gkbcinc.com> on 2004/08/19 10:30:45 UTC

Toomany Client-side validation code!!!

Hai all

when we use Struts Validator in client side, it creates too big and many 
unwanted functions in the client side,

is it possible to reduce or copy all javascript functioins into .js file 
and attach them so client dont want to read too much codes ?

any solution there in Struts 1.1

Thanks,
Rajesh

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


Re: Toomany Client-side validation code!!!

Posted by Shinobu Kawai <sh...@ieee.org>.
Hi Rajesh,

> you  mean dynamicJavascript=false
> 
> what will happen if i give it.
> 
> normally html:javascript will create a main function called
> 
> validate<formname>(form) {....}
> 
> will this function writes ?  if so then where all the other functions goes ?
The javascript tag produces javascript in two parts: dynamic and static. 
The dynamic part is the one you stated above, and it is made per form,
according to the validation.xml.  The static part is the same whatever
way you do it.  It is the static part that you would want to throw out
into a .js file or whatever.  The dynamic part, I suggest you stick with
it.

Anyways, quoting the user guide, "if dynamicJavascript is set to true
and staticJavascript is set to false then only the dynamic JavaScript
will be rendered".  Put this in each of your JSP's.  "If
dynamicJavascript is set to false and staticJavascript is set to true
then only the static JavaScript will be rendered".  Put this in a
separate JSP and include that JSP in all of your other JSP's.

> >Take a look at
> >    http://struts.apache.org/userGuide/struts-html.html#javascript
> >2nd paragraph gives you the answer.

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <shinobu@ieee.org, shinobu@computer.org>




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


Re: Toomany Client-side validation code!!!

Posted by Rajesh <ra...@gkbcinc.com>.
Hai

you  mean dynamicJavascript=false

what will happen if i give it.

normally html:javascript will create a main function called

validate<formname>(form) {....}

will this function writes ?  if so then where all the other functions goes ?

Rajesh

Shinobu Kawai wrote:

>Hi Rajesh,
>
>  
>
>>when we use Struts Validator in client side, it creates too big and many 
>>unwanted functions in the client side,
>>
>>is it possible to reduce or copy all javascript functioins into .js file 
>>and attach them so client dont want to read too much codes ?
>>    
>>
>Take a look at
>    http://struts.apache.org/userGuide/struts-html.html#javascript
>2nd paragraph gives you the answer.
>
>Best regards,
>-- Shinobu Kawai
>
>--
>Shinobu Kawai <shinobu@ieee.org, shinobu@computer.org>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>


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


Re: Toomany Client-side validation code!!!

Posted by Shinobu Kawai <sh...@ieee.org>.
Hi Rajesh,

> when we use Struts Validator in client side, it creates too big and many 
> unwanted functions in the client side,
> 
> is it possible to reduce or copy all javascript functioins into .js file 
> and attach them so client dont want to read too much codes ?
Take a look at
    http://struts.apache.org/userGuide/struts-html.html#javascript
2nd paragraph gives you the answer.

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <shinobu@ieee.org, shinobu@computer.org>




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