Just force them to enter a date correctly.


-----Original Message-----
From: Ken Ferguson [mailto:[EMAIL PROTECTED] 
Sent: 07 July 2005 14:01
To: CF-Talk
Subject: Re: Validation of Date on Form

I most certainly agree with slapping people silly when they can't even 
enter a date properly. I just thought I'd mention it in case the OP 
needed to be sure of what he was getting.

--Ferg

Dawson, Michael wrote:

>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?
>>>      
>>>
>
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211312
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to