Wendy,

We had the same issue where users were used to doing very little to enter a
date, so we employ a read only text box and a calendar pop up, ala
travelocity.  The pop up returns the selected (and always valid) date in
DD-MON-YYYY format that can be easily be parsed by the action.

We also do some JavaScript validation since the date needs to be in the
future.

-c

----- Original Message -----
From: "Wendy Smoak" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Tuesday, November 05, 2002 5:07 PM
Subject: RE: Dates & validation


> > One vote for three pre-populated boxes. Saves on validation that way :)
> > Brian
>
> And if I make them read-only, that would really fix it!  ;) I think the
> three-boxes approach comes with its own problems... I did it for a "time"
> field, but there, the choices are fixed.  If I wanted drop-downs for a
date
> then I'd have to figure out what days are valid.  Blech.  Besides, the
users
> will complain.  They're used to typing in partial dates and having the
> [telnet] app magically figure out what they meant.
>
> I'm currently dissecting the struts-validator example, and my first
concern
> is that all of the actions have validate="true" in struts-config.xml.  I
> don't think I can do that.  The user may go off to a resolution page and
> come back before the form needs to be validated.
>
> Without validate="true" in the <action> tag in struts-config, is the
> Validator Plugin even going to work?  Is there a way to manually validate?
> In my case, I have a LookupDispatchAction, and I only want to validate at
> the last minute-- the user has pressed the 'Finish' button and the
'action'
> request parameter has caused the 'saveContact()' method in my
> LookupDispatchAction to be called.
>
> Is it as simple as manually calling validate() and placing the
ActionErrors
> object into request scope with the appropriate name, which I think is
> 'org.apache.struts.action.ERROR'?  I know someone explained this to me a
> week or so ago, but apparently it didn't stick.  Brain overload.
>
> --
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University PA Information Resources Management
>
>


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

Reply via email to