Let me ask you this:

Presumably whatever the user enters is going to be used to construct a Date
object.

And if you do that, you presumably also know which of the various formats it
got entered in.

And if you have the logic somewhere to divine which format it's in, it
sounds like you have what you need to write your own validate() method to do
the job.

If you want to use the validator for your other validations, just make sure
you call super.validate().

-Joe

> -----Original Message-----

> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 24, 2004 11:58 AM
> To: Struts Users Mailing List
> Subject: Date Validation
>
>
>
>
>
>
> When I search the archive I get no results for the word "date" so here
> goes.
>
> I've been using the validation plug-in to validate the date format of
> MM/dd/yyyy.  A new requirement is to allow the user to enter
> a date in one
> of several formats(mmddyy, mm/dd/yyyy, and others).  Can the
> validator do
> this or will I have to write my own validation?  I tried multiple
> datePattern vars in the validation.xml but as expected only
> one worked.  I
> don't have the javascript validation available because I'm using
> ValidatorActionForm.  It seems like my options are to switch to
> ValidatorForm or code javascript in the JSP.  Experienced
> opinions would be
> appreciated as I'm learning as I go here.
>
> Thanks,
> Bart
>
>
> mailto: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> 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