1. Do you have an ActionForm for the action that ends up being rendered by
Velocity?
2. Does this form have a section in the Struts validation definition files?
3. Is validation setup OK (i.e. in Struts files)?
4. Does validation work server-side?

AFAIR, no. 2 is most likely the culprit.

You also may want to check if your Struts is 1.2.x. If so, you'd be better
off using the (afaik not released yet) velocity-tools-1.2. Get the latest
sources, compile and use. It's really stable (at least that's what I
currently use).

----- Original Message ----- 
From: "James Carlyle" <[EMAIL PROTECTED]>
To: <velocity-user@jakarta.apache.org>
Sent: Thursday, February 17, 2005 3:30 PM
Subject: ValidatorTool: getDynamicJavascript does not produce output


> Hi
>
> I am using the Velocity ValidatorTool to do client side javascript
> validation for my Struts application.
>
> I have placed calls to $validator.getStaticJavascript() and
> getDynamicJavascript() in my .vm template.  For example
>
> $validator.getDynamicJavascript("${formName}")
>
> The static call works (produces a <script> block) but the dynamic one
> doesn't produce anything.
>
> I am using these jars:
>
> velocity-tools-1.1.jar (contains ValidatorTool.class, dated 17 May 2004)
> velocity-1.4.jar
> velocity-dep-1.3.1.jar
>
> Many thanks if you can help
>
> James
>
> p.s. content generated by static call is this:
>
> <script type="text/javascript" language="Javascript1.1">
>
> <!-- Begin
>
>
>
>    /*$RCSfile: validateFloatRange.js,v $ $Revision: 1.9 $ $Date:
2004/03/28 16:53:21 $ */
>     /**
>     * Check to see if fields are in a valid float range.
>     * Fields are not checked if they are disabled.
>     * <p>
>     * @param form The form validation is taking place on.
>     */
>     function validateFloatRange(form) {
>
> ---- massive snipping ------
>
>         if (fields.length > 0) {
>            focusField.focus();
>            alert(fields.join('\n'));
>         }
>         return isValid;
>     }
>
>
> //End -->
> </script>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to