Hi all,
I'm coming up with a small date problem and was
wondering if someone could help.
I have a date in a form. This is vacating date on
a property website. (the user can let the agency know when they are leaving a
property). This date must me more than 3 weeks away or else the user gets a
message before they can submit the form.
This is code i have:
<cfif (isdate(form.vacating_date) and
DateCompare(lsdateformat(form.vacating_date), DateAdd("d", +21, now())) eq 1)
OR isdefined("form.vacancy_date_okd")>
Form submits....
<cfelse>
tell user that the date is in the next 21
days
They check a box called vacancy_date_okd and dont
get the message again (or they change the date).
</cfif>
If i put in a date like 13/04/2004 and it tells
the user that there is a problem
#lsdateformat(form.vacating_date,"full")# = Tuesday, 13 April
2004
#dateformat(form.vacating_date,"full")# = Tuesday, April 13, 2004
But if i put in a date like 08/04/2004 it submits
the form without warning the user...
#lsdateformat(form.vacating_date,"full")# =
Thursday, 8 April
2004
#dateformat(form.vacating_date,"full")# = Wednesday, August 4, 2004
Any ideas of
how to do the datecompare?
Thanks
Gav
---
You are currently
subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank
email to [EMAIL PROTECTED]
MXDU2004 + Macromedia
DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February,
2004
---