Well, true, but you have to assume that people are capable of typing
dates in any "normal" date format.  If they type "403" for a date, they
should be slapped silly, the shown an error message.

I assumed "any number of formats" meant reasonable dates syntaxes.

If it were me, I would use qForms API to mask the field using
javascript, then I would use isDate() to ensure it doesn't get through
to the app server. 

-----Original Message-----
From: Ken Ferguson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 06, 2005 6:13 PM
To: CF-Talk
Subject: Re: Validation of Date on Form

depending on how you're handling the data, isDate can give you some
funkiness. There are a lot of values which are considered "valid date
objects" which don't fit your actual needs for a date. I'd go with Bob's
suggestion of a regex.
eg.
#isdate("403")# -- NO
#isdate("4/03")# -- YES
#isdate("4-03")# -- YES
#isdate("4.03")# -- YES
#isdate("1030")# -- NO

Dawson, Michael wrote:

>How about isDate()? 
>
>-----Original Message-----
>From: Bob Clingan [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, July 06, 2005 11:12 AM
>To: CF-Talk
>Subject: Validation of Date on Form
>
>You will to write regular expressions to check for those types of dates

>you want to allow. Don't forget about sanity checks like 31st in a 
>month with 30 days and leap year.
>
>  
>
>>I've got a number of forms in an administration area that will accept 
>>a
>>    
>>
>
>  
>
>>date in any number of formats
>>
>>mm/dd/yyyy
>>mm/dd/yy
>>July 4, 2005
>>
>>...and so on...
>>
>>I need a way to validate this field so if somebody types something 
>>other than an accepted date (like "Bob") they get an alert saying 
>>"Please format your date like XXXXX".
>>
>>Looks pretty easy with CF 7, but their host ain't running CF 7.
>>
>>Suggestions?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211302
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to