Page 1 of 1

PHP Form | Time Input

Posted: Tue Jun 30, 2009 9:32 pm
by FoolishThinker
Hi. I am trying to create a form that would allow users to enter time (e.g. 3:36 PM) on a text field. I need the users to enter it in a 12 hour format and indicate whether its AM or PM. Can someone please teach me how to do this or tell me a good way to code this in php? I'd really appreciate it. :D

Re: PHP Form | Time Input

Posted: Tue Jun 30, 2009 10:18 pm
by califdon
FoolishThinker wrote:Hi. I am trying to create a form that would allow users to enter time (e.g. 3:36 PM) on a text field. I need the users to enter it in a 12 hour format and indicate whether its AM or PM. Can someone please teach me how to do this or tell me a good way to code this in php? I'd really appreciate it. :D
I would recommend using 3 separate select elements so that you get reliable data.

Code: Select all

+-----+-+   +------+-+   +------+-+
|  1  |V| : |  00  |V|   |  AM  |V|
+-----+-+   +------+-+   +------+-+

Re: PHP Form | Time Input

Posted: Wed Jul 01, 2009 12:05 pm
by FoolishThinker
thanks a lot for the idea! :D