Maybe I didn't make myself clear. This is not about the static code, but
about the dynamic code. If you read my original posting, than you will
see that I have put the static JavaScript already to false:
<html:javascript formName="frm_ccd_clm_Filter" staticJavascript="false"
dynamicJavascript="true" /> However my mail prog removed the line brakes
and therefore this wasn't readable well. Apologies for that.
My problem is, that all the dynamic functions overwrite each other:
mask(), maxlength(), ... are dynamic parts of the JavaScript, since the
ApplicationProperty labels are generated in there e.g.: function
maxlength () {
this.aa = new Array("businessName", "BusinessName shouldn't be
longer than 50 characters.", new Function ("varName",
"this.maxlength='50'; return this[varName];"));
this.ab = new Array("surname", "Other Text", new Function
("varName", "this.maxlength='50'; return this[varName];")); }
Cheers,
Martin
==================================================
Original Message:
The html:javascript tag has a parameter named 'statisJavascript' which
says
if Struts has to render all static code (i.e. the validations
functions).
So, if you have several form in a page, you should write something like
this :
<html:javascript formName="formA" />
<html:javascript formName="formB" staticJavascript="false" />
<html:javascript formName="formC" staticJavascript="false" />
...
Thus, validation functions will appear only once.
HTH
Thomas
At 17:23 04/09/2003, you wrote:
>Hi,
>
>I'm having problems when validating a multiform page.
>I have 4 forms on a single page and I've set up the validation
framework
>for them. When I insert the html:javascript tag on the jsp page to
>create the dynamic code, it creates sth like this:
>
><script type="text/javascript" language="Javascript1.1">
> function validateFrm_ccd_crn_Filter(form) { [...] }
> function maxlength () { this.aa = [...] }
></script>
><script type="text/javascript" language="Javascript1.1">
> function validateFrm_ccd_par_Filter(form) { [...] }
> function maxlength () { this.aa = }
> function mask () { [...] }
></script>
><script type="text/javascript" language="Javascript1.1">
> function validateFrm_ccd_pol_Filter(form) { [...] }
> function maxlength () { this.aa = [...] }
> function mask () { this.aa = [...] }
></script>
>
>The problem is, that the mask and maxlength methods overwrite each
>other. Therefore the client side validation does work only for the last
>form that is used on the page.
>Anything that I should different than including:
>dynamicJavascript="true" /> dynamicJavascript="true" />
>dynamicJavascript="true" /> dynamicJavascript="true" /> on the JSP
page?
>The server side validation works fine btw. Any help highly appreciated.
>Cheers, Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]