struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@attws.com>
Subject RE: Validation Javascript
Date Thu, 05 Sep 2002 15:21:54 GMT
> -----Original Message-----
> From: NP-KARRYS MIKE [mailto:NP-KARRYS_MIKE@subcontractor.PRC.com]
> Sent: Thursday, September 05, 2002 8:05 AM
> To: struts-user@jakarta.apache.org
> Subject: Validation Javascript
> 
> Could somebody please explain the following. I'm probably 
> missing something
> simple but I just don't understand how the validate code is 
> accessed and
> called from the validation.xml and validation-rules.xml files.
> [deleted]
> I can see how the validateLogonForm is called but not how the 
> other code is
> called.
> How does the validateMaxLength and validateMinLength calls 
> get executed when
> they are not included, as far as I can see in the page source 
> window, in the
> downloaded page?

I don't remember where I saw the basic validator examples, but if you can
find them, you'll see the use of both the "dynamicJavascript" and
"staticJavascript" attributes of the "<html:javascript>" element, but in
different places.

In the example I saw, you have a JSP file (called "staticJavascript.jsp")
that has almost nothing but the following line:

  <html:javascript dynamicJavascript="false" staticJavascript="true"/>

Then, in each of your pages that need validation, you would have something
like this:

  <html:javascript formName="<formname>"
                   dynamicJavascript="true" staticJavascript="false"/>

AND:

  <script language="Javascript1.1"
src="<contextroot>/staticJavascript.jsp"></script>

If you use Tiles, the latter line could go in the layout, and the former
would go in your "body page".

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


Mime
View raw message