myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Bischoff <jbisch...@klkurz.com>
Subject Re: inputCalendar validator
Date Fri, 01 Dec 2006 20:56:09 GMT
Yaron,

I think you did not quite understand his scenario. The user is entering 
"MM/dd/YY" format (by hand, not clicking) instead of "MM/dd/yyyy". A 
validator could easily detect that the year entered is too short, and 
send a message stating such back to the user.

Now in the case of MM/dd being confused with dd/MM.... there, you would 
really be in trouble. :)

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.

Yaron Spektor wrote:
> Don't you sometimes wish you could replace some of your users :->
> 
>  
> 
> But seriously, your question does not seem to be a JSF related question,
> if the user clicks a valid date you can not check (as far as I know)
> what he thought when he entered it.
> 
> My workaround would be to switch the input to comboBox, then you don't
> need any validation. In order to solve your problem, present the month
> as names "Jan", "Feb" etc. while leaving the dates as numbers, that
> should do the trick.
> 
>  
> 
> Good luck :->
> 
> ________________________________
> 
> From: Whitmire, Tracy Carroll [mailto:tcwhitm@sandia.gov] 
> Sent: Friday, December 01, 2006 2:09 PM
> To: users@myfaces.apache.org
> Subject: inputCalendar validator
> 
>  
> 
> Hi, 
> 
> I'm using t:inputCalendar and have a question I'm sure someone has
> already addressed.  But a google search was futile. 
> 
> If a user decides to enter the input in manually .... What's the best
> way to validate this input? 
> 
> I have a user who loves to enter the date as MM/dd/YY ignoring the help
> text 
> 
> But the expected is MM/dd/yyyy 
> 
> So when he enters 12/01/06 .... 
> 
> It gets entered into the database as Dec, 01, 0006 
> 
> Thanks for your help, 
> 
> tc 
> 
> 



Mime
View raw message