|
Hi Gavin
I have found that MS IE in particular can stuff
this up - repeatedly resubmitting the same form multiple times switches the day
and month of the date if both day and month are LTE 12. I also used the LSformat
functions...
The solution I ended up using was a "date control",
with drop down list of day, month name and a text box for a year. The user can
select the day and month, and the year is entered (can default year to this year
if need be etc).
When the form submits, i put the values back
together, CF has no problem parsing or comparing 8/april/2004, and MS IE
cannot muck with the date, as each value is submitted as a separate form
value.
The date control was a custom tag, and a second
custom tag "rejoined" the date components once the form was
submitted.
Another solution. Let me know if you'd like a look
at the tags :)
Hope you have success which ever way you
go.
Aaron
----- Original Message -----
Sent: Thursday, April 01, 2004 2:03 PM
Subject: [cfaussie] RE: datecompare problem
Thanks folks, that worked a treat.
----- Original Message -----
Sent: Thursday, April 01, 2004 1:42
PM
Subject: [cfaussie] RE: datecompare
problem
or
even
variable=CreateDate(GetToken(form.date,3,'/'),GetToken(form.date,2,'/'),GetToken(form.date,1,'/'));
Gareth.
Try something like createDate(listLast(form.date,
"/"), listGetAt(form.date, 2, "/"), listLast(form.date,
"/"))
Taco Fleur 07 3535 5072
Tell me and I will forget Show me and I
will remember Teach me and I will learn
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 --- 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
--- 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
--- 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
---
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
|