You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Phil Shrimpton <ph...@shrimpton.co.uk> on 2003/07/17 15:06:21 UTC
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
Re: Validator : date
Posted by Phil Shrimpton <ph...@shrimpton.co.uk>.
On Thursday 17 July 2003 13:15, Michael Nascimento Santos wrote:
Hi,
> 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>
Same error, but if I change it to...
var-name>datePatternStrict</var-name>
..it works. Also, according to the docs I have, you don't need to supply the
datePattern, as it will default to the locales short date format
Phil
--
2:02pm up 92 days, 2:55, 1 user, load average: 0.02, 0.04, 0.01
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
Re: Validator : date
Posted by Michael Nascimento Santos <mi...@hotmail.com>.
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" <ph...@shrimpton.co.uk>
To: <st...@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