RE: entering time
Individual selects are virtually idiot-proof, but I think they're too annoying. Why don't you test the input with IsDate()? -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 16, 2002 9:42 AM To: CF-Talk Subject: entering time Can anyone make a suggestion on the best/standard way to setup data entry for time.. Specifically for a entry field for an event start time. I've thought about a text box, but that would seem to allow too many mistakes for the data entry person.. I've considered drop down select boxes for hour, AM/PM and minutes.. But there must be a standard, best way to do this for database entry using CF (or maybe even javascript) Thanks in advance Tim Laureska ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: entering time
yep and store your date as a Julian integer.I cant really say why, I just like doing it :-) -Original Message- From: Everett, Al [mailto:[EMAIL PROTECTED]] Sent: 16 October 2002 14:48 To: CF-Talk Subject: RE: entering time Individual selects are virtually idiot-proof, but I think they're too annoying. Why don't you test the input with IsDate()? -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 16, 2002 9:42 AM To: CF-Talk Subject: entering time Can anyone make a suggestion on the best/standard way to setup data entry for time.. Specifically for a entry field for an event start time. I've thought about a text box, but that would seem to allow too many mistakes for the data entry person.. I've considered drop down select boxes for hour, AM/PM and minutes.. But there must be a standard, best way to do this for database entry using CF (or maybe even javascript) Thanks in advance Tim Laureska ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: entering time
Ok... wasn't aware of that function, but it sounds good then I assume a text box would be OK?? (with supplying data entry person with entry format ex. 5/11/02) -Original Message- From: Everett, Al [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 16, 2002 9:48 AM To: CF-Talk Subject: RE: entering time Individual selects are virtually idiot-proof, but I think they're too annoying. Why don't you test the input with IsDate()? -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 16, 2002 9:42 AM To: CF-Talk Subject: entering time Can anyone make a suggestion on the best/standard way to setup data entry for time.. Specifically for a entry field for an event start time. I've thought about a text box, but that would seem to allow too many mistakes for the data entry person.. I've considered drop down select boxes for hour, AM/PM and minutes.. But there must be a standard, best way to do this for database entry using CF (or maybe even javascript) Thanks in advance Tim Laureska ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
Re: entering time
Can anyone make a suggestion on the best/standard way to setup data entry for time.. Specifically for a entry field for an event start time. I've thought about a text box, but that would seem to allow too many mistakes for the data entry person.. I've considered drop down select boxes for hour, AM/PM and minutes.. But there must be a standard, best way to do this for database entry using CF (or maybe even javascript) Thanks in advance Users are liable to find multiple drop-downs frustrating. For that matter, single drop-downs can be very frustrating if they are especially long. For instance, you don't want to have an event start date drop-down with one entry for every minute of the day -- one entry for every five minutes is even likely to be frustrating. If you can assume that any given start or end time for an event will only occur between certain hours and on the half or quarter hour ( i.e. from 9-5 mon-fri, every half hour ), then you might be able to get a drop down to a reasonable size that users won't be horribly frustrated by them. In this setup, I can double-tap the 2 key on my keyboard and instantly hit 2:30, so it's actually fairly convenient ( more so than a text field ). In failing that, the next best thing is probably going to be a text field. You can validate this with javascript to make sure the text is in the format HH:mm, however, you should also validate this on the server-side ( server-side validation really should be performed for anything, if for no other reason to be certain the javascript conveniences are working properly )... Something like this should generally work fairly well to determine if what is entered is a valid time: cfset mytime = listtoarray(form.starttime,:) cfif arraylen(mytime) neq 2 or not isnumeric(mytime[1]) or not isnumeric(mytime[2]) or mytime[1] lt 1 or mytime[1] gt 24 or mytime[2] lt 1 or mytime[2] gt 59 cfthrow type=custom message=Invalid start time /cfif Of course, there are regex methods of checking this and the like, i.e. cfif not REFindNoCase([0-2]?[0-9]:[0-9]{2,2},form.starttime) or listgetat(form.starttime,1,:) gt 24 or listgetat(form.starttime,2,:) gt 59 cfthrow ... /cfif It all depends on what you're comfortable with of course... If you're not familiar with Regular Expressions ( the 2nd example ) and want more info, there's also a [EMAIL PROTECTED] list which has some fairly knowledgeable people on it, including Mike Dinowitz who maintains the house of fusion. :) hth S. Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
Re: entering time
Tim Laureska wrote: Can anyone make a suggestion on the best/standard way to setup data entry for time.. Specifically for a entry field for an event start time. I've thought about a text box, but that would seem to allow too many mistakes for the data entry person.. I've considered drop down select boxes for hour, AM/PM and minutes.. But there must be a standard, best way to do this for database entry using CF (or maybe even javascript) Thanks in advance Personally, I prefer to use 2 text fields separated by a colon. Each textfield can hold 2 numbers and since a 24 hour clock is standard there is no need for an AM/PM field. Throw in some javascript so both fields have an onFocus behaviour that selects their content. Both easy to validate and easy to use. Jochem ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: entering time
I don't think he's validating date input in this instance, although you raise a good point, and something that didn't occur to me in my last post: cftry cfset mytime = CreateTime(ListFirst(form.starttime,:),ListLast(form.starttime,:),0) cfcatchinvalid date/cfcatch /cftry There isn't any IsTime function, although I suppose on CF5 or MX you could write this into a UDF... though for performance you probably wouldn't want to use cftry in the UDF ( it's not possible on CF 5 ). function IsTime(timestring) { var delim = :; var rexp = ^[0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?(a|p|am|pm)?$; timestring = REReplace(timestring,[[:space:]],,ALL); if (not REFindNoCase(rexp,timestring)) { return false; } if (listfirst(timestring,delim) gt 24) { return false; } else if (REFindNoCase([ap],timestring) and listfirst(timestring,delim) gt 12) { return false; } else { return true; } } This is probably a better solution than my previous post ( assuming CF 5+ ) since it's horribly portable, and allows you to use this function over and over for start and end event times, etc. throughout your app. I suspect you'll want to use something like this in at least 2 places, which probably makes it worthwhile. Theoretically this test would determine whether or not you could pass the timestring variable to timeformat() to produce whatever standard time format you want. hth S. Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 Individual selects are virtually idiot-proof, but I think they're too annoying. Why don't you test the input with IsDate()? -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 16, 2002 9:42 AM To: CF-Talk Subject: entering time Can anyone make a suggestion on the best/standard way to setup data entry for time.. Specifically for a entry field for an event start time. I've thought about a text box, but that would seem to allow too many mistakes for the data entry person.. I've considered drop down select boxes for hour, AM/PM and minutes.. But there must be a standard, best way to do this for database entry using CF (or maybe even javascript) Thanks in advance Tim Laureska ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: entering time
... since a 24 hour clock is standard there is no need for an AM/PM field. It's my experience that most Merkins don't do well with 24-hour clocks. ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: entering time
Easy mathematical evaluation? :) yep and store your date as a Julian integer.I cant really say why, I just like doing it :-) -Original Message- From: Everett, Al [mailto:[EMAIL PROTECTED]] Sent: 16 October 2002 14:48 To: CF-Talk Subject: RE: entering time Individual selects are virtually idiot-proof, but I think they're too annoying. Why don't you test the input with IsDate()? -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 16, 2002 9:42 AM To: CF-Talk Subject: entering time Can anyone make a suggestion on the best/standard way to setup data entry for time.. Specifically for a entry field for an event start time. I've thought about a text box, but that would seem to allow too many mistakes for the data entry person.. I've considered drop down select boxes for hour, AM/PM and minutes.. But there must be a standard, best way to do this for database entry using CF (or maybe even javascript) Thanks in advance Tim Laureska ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: entering time
as Penry, the mild mannered Janitor would say... COULD BE -Original Message- From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]] Sent: 16 October 2002 16:28 To: CF-Talk Subject: RE: entering time Easy mathematical evaluation? :) yep and store your date as a Julian integer.I cant really say why, I just like doing it :-) -Original Message- From: Everett, Al [mailto:[EMAIL PROTECTED]] Sent: 16 October 2002 14:48 To: CF-Talk Subject: RE: entering time Individual selects are virtually idiot-proof, but I think they're too annoying. Why don't you test the input with IsDate()? -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 16, 2002 9:42 AM To: CF-Talk Subject: entering time Can anyone make a suggestion on the best/standard way to setup data entry for time.. Specifically for a entry field for an event start time. I've thought about a text box, but that would seem to allow too many mistakes for the data entry person.. I've considered drop down select boxes for hour, AM/PM and minutes.. But there must be a standard, best way to do this for database entry using CF (or maybe even javascript) Thanks in advance Tim Laureska ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com
RE: entering time
... since a 24 hour clock is standard there is no need for an AM/PM field. It's my experience that most Merkins don't do well with 24-hour clocks. It's my experience that most Merkins don't know how long it takes the Earth to go round the Sun. But let's not start that. Tom Chiverton You don't have to be a mad scientist to believe in ColdFusion ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: entering time
It was my understanding that IsDate validated time as well. Date/Time objects it says in the docs. -Original Message- From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 16, 2002 11:10 AM To: CF-Talk Subject: RE: entering time I don't think he's validating date input in this instance, although you raise a good point, and something that didn't occur to me in my last post: cftry cfset mytime = CreateTime(ListFirst(form.starttime,:),ListLast(form.startti me,:),0) cfcatchinvalid date/cfcatch /cftry There isn't any IsTime function, although I suppose on CF5 or MX you could write this into a UDF... though for performance you probably wouldn't want to use cftry in the UDF ( it's not possible on CF 5 ). function IsTime(timestring) { var delim = :; var rexp = ^[0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?(a|p|am|pm)?$; timestring = REReplace(timestring,[[:space:]],,ALL); if (not REFindNoCase(rexp,timestring)) { return false; } if (listfirst(timestring,delim) gt 24) { return false; } else if (REFindNoCase([ap],timestring) and listfirst(timestring,delim) gt 12) { return false; } else { return true; } } This is probably a better solution than my previous post ( assuming CF 5+ ) since it's horribly portable, and allows you to use this function over and over for start and end event times, etc. throughout your app. I suspect you'll want to use something like this in at least 2 places, which probably makes it worthwhile. Theoretically this test would determine whether or not you could pass the timestring variable to timeformat() to produce whatever standard time format you want. hth S. Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 Individual selects are virtually idiot-proof, but I think they're too annoying. Why don't you test the input with IsDate()? -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 16, 2002 9:42 AM To: CF-Talk Subject: entering time Can anyone make a suggestion on the best/standard way to setup data entry for time.. Specifically for a entry field for an event start time. I've thought about a text box, but that would seem to allow too many mistakes for the data entry person.. I've considered drop down select boxes for hour, AM/PM and minutes.. But there must be a standard, best way to do this for database entry using CF (or maybe even javascript) Thanks in advance Tim Laureska ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
Re: entering time
Everett, Al wrote: ... since a 24 hour clock is standard there is no need for an AM/PM field. It's my experience that most Merkins don't do well with 24-hour clocks. Well, somebody decided that the official format in the US is 24-hour ;) http://www.time.gov/ Jochem ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: entering time
... since a 24 hour clock is standard there is no need for an AM/PM field. It's my experience that most Merkins don't do well with 24-hour clocks. It's my experience that most Merkins don't know how long it takes the Earth to go round the Sun. But let's not start that. 30 days? :) S. Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: entering time
Hmm... okay ... serves me right for not checking the docs first. :) I'll have to test it and see how it handles just taking hh:mm without any actual date value... S. Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 It was my understanding that IsDate validated time as well. Date/Time objects it says in the docs. -Original Message- From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 16, 2002 11:10 AM To: CF-Talk Subject: RE: entering time I don't think he's validating date input in this instance, although you raise a good point, and something that didn't occur to me in my last post: cftry cfset mytime = CreateTime(ListFirst(form.starttime,:),ListLast(form.startti me,:),0) cfcatchinvalid date/cfcatch /cftry There isn't any IsTime function, although I suppose on CF5 or MX you could write this into a UDF... though for performance you probably wouldn't want to use cftry in the UDF ( it's not possible on CF 5 ). function IsTime(timestring) { var delim = :; var rexp = ^[0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?(a|p|am|pm)?$; timestring = REReplace(timestring,[[:space:]],,ALL); if (not REFindNoCase(rexp,timestring)) { return false; } if (listfirst(timestring,delim) gt 24) { return false; } else if (REFindNoCase([ap],timestring) and listfirst(timestring,delim) gt 12) { return false; } else { return true; } } This is probably a better solution than my previous post ( assuming CF 5+ ) since it's horribly portable, and allows you to use this function over and over for start and end event times, etc. throughout your app. I suspect you'll want to use something like this in at least 2 places, which probably makes it worthwhile. Theoretically this test would determine whether or not you could pass the timestring variable to timeformat() to produce whatever standard time format you want. hth S. Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 Individual selects are virtually idiot-proof, but I think they're too annoying. Why don't you test the input with IsDate()? -Original Message- From: Tim Laureska [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 16, 2002 9:42 AM To: CF-Talk Subject: entering time Can anyone make a suggestion on the best/standard way to setup data entry for time.. Specifically for a entry field for an event start time. I've thought about a text box, but that would seem to allow too many mistakes for the data entry person.. I've considered drop down select boxes for hour, AM/PM and minutes.. But there must be a standard, best way to do this for database entry using CF (or maybe even javascript) Thanks in advance Tim Laureska ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: entering time
It's my experience that most Merkins don't do well with 24-hour clocks. Well, somebody decided that the official format in the US is 24-hour ;) http://www.time.gov/ Yes. However, unless you're in the U.S. military, it's rare that you'll use 24-hour time here. That's one of the (sometimes) nice things about this country - standards may be official, but they're rarely imposed on the population without prior acceptance by society. Witness the failure of the metric system here, for example. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com
RE: entering time
It's my experience that most Merkins don't do well with 24-hour clocks. Well, somebody decided that the official format in the US is 24-hour ;) http://www.time.gov/ That's as may be, but all the non-techie types I know--that didn't serve in the military--will look at you funny if you tell them that WWE is on at 1930. ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
RE: entering time
It's my experience that most Merkins don't do well with 24-hour clocks. It's my experience that most Merkins don't know how long it takes the Earth to go round the Sun. But let's not start that. 30 days? :) Fat lot you know. Everyone knows it takes the Sun 24 hours to go around the Earth. ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com
RE: entering time
... since a 24 hour clock is standard there is no need for an AM/PM field. It's my experience that most Merkins don't do well with 24-hour clocks. It's my experience that most Merkins don't know how long it takes the Earth to go round the Sun. But let's not start that. Not fair; that's a trick question. Every Merkin knows that the sun (and everything else in the universe) rotates around the Earth. Sheesh. -- Mosh Teitelbaum evoch, LLC Tel: (301) 625-9191 Fax: (301) 933-3651 Email: [EMAIL PROTECTED] WWW: http://www.evoch.com/ ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
RE: entering time
It's my experience that most Merkins don't do well with 24-hour clocks. Well, somebody decided that the official format in the US is 24-hour ;) http://www.time.gov/ That's as may be, but all the non-techie types I know--that didn't serve in the military--will look at you funny if you tell them that WWE is on at 1930. Maybe they're looking at you funny because WWE PPVs are on at 20:00... 8^) -- Mosh Teitelbaum evoch, LLC Tel: (301) 625-9191 Fax: (301) 933-3651 Email: [EMAIL PROTECTED] WWW: http://www.evoch.com/ ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm