The moose likes JSF and the fly likes Date Validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Date Validation" Watch "Date Validation" New topic

Date Validation

Vidu Greg

Joined: Sep 05, 2005
Posts: 10

I am having a problem in this. I dont want a user to pick a previous date so I am having minimum "now".

<h:inputText value="#{myBean.effectiveDate}" id="effectiveDate">
<f:convertDateTime type="date" pattern="MM/dd/yyyy"/><hx:inputHelperDatePicker />
<hx:validateDateTimeRange minimum="#{now}" />

but the problem is when user enters today's date, it validate time also and then gives validation error because by default the time is 12 PM and if user is trying after 12 PM, it will give validation error. I am using a pattern also but still having problem.

thanks in advance.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60791

"vd grg",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

JavaRanch Sheriff

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: Date Validation
Similar Threads
How to show a single error message for all fields
Refresh values of JSF page before validation occurs
f:convertDateTime issue
replacing default validator message at h:messages
validate convertDateTime