FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » validating / converting time for insertion into mysql DB??
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: validating / converting time for insertion into mysql DB?? [message #172213 is a reply to message #172191] Fri, 04 February 2011 15:37 Go to previous messageGo to previous message
Michael Fesser is currently offline  Michael Fesser
Messages: 215
Registered: September 2010
Karma:
Senior Member
.oO(Denis McMahon)

> […]
> And you might also want to consider the following field formats:
>
> h/hh:m/mm:s/ss
> hmmss
> hhmmss
> mmss
> mss
>
> The last two give you problems. How do you tell whether 3 or 4 digits is
> hours and minutes or minutes and seconds?
>
> The real problem is that you're allowing your user to give you ambiguous
> input and then trying to make sense of it.
>
> Use more form fields: t1hours t1mins and t2hours t2mins

While this solves the ambiguity problem, it creates a usability problem
and is a pain to use. Even more ugly would be dropdown lists …

The best method for the user is a single field, and the developer should
take care of the correct parsing. You could also enforce a particular
format and reject all other ones (of course then there should be a short
note or an example near the input field how to enter the time).

> You could use select lists for hours and minutes

Arrrgh … ;-)

> although 60 element
> select lists are "too long" for some people's liking.

People who do this also eat little children.

Micha
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: pass variable in php construct
Next Topic: Looping through Web Service results
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 17:32:12 GMT 2024

Total time taken to generate the page: 0.04148 seconds