Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 19th, 2007, 4:56 PM   #1
Druid
Programmer
 
Join Date: Mar 2006
Posts: 40
Rep Power: 0 Druid is on a distinguished road
Date and Time on HTML Form

I have a HTML form displayed via PHP. Currently, the user enters the time and date in a textbox but military time may be a bit difficult for some of the users to calculate. I was wondering if there was a display a visual calendar (I've seen a few examples of this in javascript) and a clock that can allow the user to select the date and time instead of just entering in a string that has to be of a proper format. I was trying to avoid a sequence of dropdown boxes, but that's my last resort. A PHP method to do this would be preferred, but I'm beginning to think it will have to be a Javascript deal. Has anyone developed a date/time gui for a web form or know where I can find one?
Druid is offline   Reply With Quote
Old Apr 19th, 2007, 4:59 PM   #2
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 710
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
It wouldn't make sense to try and do it through PHP, that's not what PHP was meant for. If your trying to get the time they submitted the form, then you should take the current time using PHP once they have submitted the page. Depending on how you are formatting the time, you could use a combo box and put every hour in. If you want to the minute or second, then a miniature clock or formatted box(s) of some kind would be best.
Booooze is offline   Reply With Quote
Old Apr 19th, 2007, 5:18 PM   #3
Druid
Programmer
 
Join Date: Mar 2006
Posts: 40
Rep Power: 0 Druid is on a distinguished road
Bummer. The users just enter the time in a format of HH:MM, which 90% of the time would not be the actual time that they will be referring to, but time in the past of a particular event.

I suppose I'll go the combo box route and rebuild the strings on the server side to form the date and time.

Thanks for the info.
Druid is offline   Reply With Quote
Old Apr 19th, 2007, 6:43 PM   #4
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 4 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
What you could do is have a form. And then like you were saying, get a JavaScript Calendar/Clock and have them select the time they want. When they click on it, have JavaScript put in the time into the correct input box. You could also tell them "Enter Time As Such: HHS A/P" for Am and PM then you just have PHP do a conversion for time. There is already probably a time class in PHP that will change 12-hour time to 24-hour.
PhilBon is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Routine tbohon Perl 2 Jan 15th, 2007 12:14 PM
date() Question grimpirate PHP 2 Nov 5th, 2006 7:58 PM
Creation date comparison for subdirectories randum77 Visual Basic .NET 6 Jul 22nd, 2006 9:40 AM
using Text fields in SWT elford Java 4 Dec 27th, 2005 1:38 PM
Time between two dates and times Illuminati Visual Basic .NET 4 Apr 10th, 2005 9:33 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:32 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC