Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Struts Validator to validate *optional* date fields? (http://www.velocityreviews.com/forums/t123797-struts-validator-to-validate-optional-date-fields.html)

Marcus Leon 06-27-2003 11:29 PM

Struts Validator to validate *optional* date fields?
 
Does anyone know how to use the Struts Validator to validate dates on
*optional* fields?

The Validator validates dates fine but it always returns an
ActionError if the field is empty.

We would like to ensure that any entered date is valid but not enforce
the user to enter a date.

We tried removing the depends="required" from validator-rules.xml but
the problem remains.

Does anyone have any ideas?

Thanks

Marcus Leon 06-30-2003 06:15 PM

Re: Struts Validator to validate *optional* date fields?
 
One add'l note. It seems it is possible to validate optional integer
and long fields. Just not dates.

With numeric, the Validator does not create a requierd error if the
field is empty. If the field is not empty, and is not the correct
numeric type, than an invalid data type error is created. This is the
functionality we want.

Not sure why dates are different. Also weird as the numeric rules in
validator-rules.xml depend on required.

-Marcus

marcus_newsg@yahoo.com (Marcus Leon) wrote in message news:<3ca3f16b.0306271529.3e645b10@posting.google. com>...
> Does anyone know how to use the Struts Validator to validate dates on
> *optional* fields?
>
> The Validator validates dates fine but it always returns an
> ActionError if the field is empty.
>
> We would like to ensure that any entered date is valid but not enforce
> the user to enter a date.
>
> We tried removing the depends="required" from validator-rules.xml but
> the problem remains.
>
> Does anyone have any ideas?
>
> Thanks



All times are GMT. The time now is 10:04 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.