Discussion:
Date Range Validation
(too old to reply)
gitobu
2009-03-31 22:26:28 UTC
Permalink
I need to ensure that users do not enter a End Date that is earlier than a
Start Date and give them a mesage that Start Date can not be earlier than end
date. Any idea how i might enforce that?
See
<cfform action="Uend.cfm">
<cfinput type="text" name="startdate" validate="date" required="yes"
message="Starting when?">
<cfinput type="text" name="enddate" validate="date" required="yes"
message="Till when?">
<cfinput type="submit" value="Go" name="pushbutton">
</cfform>
Azadi
2009-04-01 01:02:19 UTC
Permalink
which validation are you talking about? client-side (javascript) or
server-side (cf)?

for server-side validation of date, cf has many useful functions like
datecompare() for example.

for client-side validation i would recomment employing a little useful
date.js (google "date.js" to find it) library which can parse manymany
date formats and do a lot with them...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Loading...