views:

431

answers:

4
+1  Q: 

Time Input Field

I am building a form to accept a time value HH:MM, how can I filter the user input and show the colon in the text field? I guess I'm looking for some kind of filtered input box.

Thanks

+2  A: 
Jonathan Sampson
+3  A: 

Thats commonly referred to as an Input Mask, do some googling on it. Edit: There appears to be an input mask jquery plugin

Allen
Thanks, that helped
Tony Borf
+1  A: 

Whilst the TimePickr plugin recommended by Jonathon is very nice to look at, if the user is doing any volume of data entry, it's going to drive them mad. I answered a similar question a while back explaining why:

jQuery time picker (StackOverflow)

A masked input box and a bit of javascript validation may be a more optimal solution.

Kev
+1 I agree - the "timepickr" isn't a solve-all.
Jonathan Sampson
I loved the look of it but when I played around in a proof of concept for one of our customer thingies I got a bit demented by it :)
Kev
A: 

Have you ever use JqueryMasked Input Plugin

http://digitalbush.com/projects/masked-input-plugin/