struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Nascimento Santos" <mister...@hotmail.com>
Subject Re: Validator : date
Date Thu, 17 Jul 2003 13:15:09 GMT
You must define a datePattern var in your validation.xml config, such as:

<field property="aDate" depends="date">
    <var>
      <var-name>datePattern</var-name>
      <var-value>MM-dd-yyyy</var-value>
    </var>
</field>

This way, the validator knows when the value entered is valid according to
your pattern. In my example, 07-17-03 would be valid, but not 17-07-03.

[]s
Michael Nascimento Santos
JSR-207 Expert Group Member
Sun Certified Programmer for the Java 2 Platform
Sun Certified Programmer for the Java 2 Platform 1.4
Sun Certified Web Component Developer for J2EE
Moderador SouJava - www.soujava.org.br

----- Original Message ----- 
From: "Phil Shrimpton" <phil@shrimpton.co.uk>
To: <struts-user@jakarta.apache.org>
Sent: Thursday, July 17, 2003 10:06 AM
Subject: Validator : date


> Hi,
>
> I am having problems with client side date validation in 1.1.  If I set
the
> depends value to include 'date', there seems to be a problem in the
> javascript generated.  I get the following error..
>
> Error: Length is null or not an object.
>
> The Error seems to be in the validation-rules.xml for the date valadation,
> line 12
>
>  (datePattern.length > 0)) {
>
> Any ideas?
>
> Phil
> -- 
>  12:56pm  up 92 days,  1:49,  1 user,  load average: 0.34, 0.13, 0.05
>            ICQ: 760757       AIM: pjshrimpton       Y!: pjshrimpton
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

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


Mime
View raw message