I forgot to mention that I'm using a DispatchAction class along with the DynaValidatorForm so the validation is declarative. So for Item 2, I'll just create my own validation rule. I just wanted to ensure that there wasn't already something available in the struts framework that I would re-invent.
On Tue, 19 Oct 2004 13:11:57 -0400, Bill Siggelkow <[EMAIL PROTECTED]> wrote: > I would approach these problems in two separate ways -- for item 1 I > would use a mask validator (regex). > > Then in the form, I would provide methods that allow you to get the > converted values. > (In the form, you will need to convert the entered String value into > either using the dashes or slashes). > > For item 2, in the ActionForm.validate() method I'd implement the date > ordering rule. There may be more clever ways ... YMMV. > > -Bill Siggelkow > > > > Milind Rao wrote: > > > I'm using the Validator framework to validate dates and I have two questions > > > > 1. I'd like the user to be able to enter a date using different > > delimiters like '/' or '-'. So both MM-dd-yyyyy and MM/dd/yyyy should > > be allowed. Is there a way to do that? Currently I'm using the > > built-in date validation and specifiying a date pattern which can only > > be one of the above. > > > > > 2. I have a start date and an end date text fields. I want to > > validate that the end date is later than or equal to the start date. > > Looks like I have to create my own validation class. Which is not a > > big deal. But I don't want to re-invent the wheel. So if this is > > already available somewhere, I'd appreciate a pointer in the right > > direction. > > > > Thanks. > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Regards Milind --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]