Welcome Guest, Not a member yet? Register   Sign In
Generating Dates & Times in Forms

This isn't really a CI specific question, but I'm doing the project in CI so I thought I'd give here a shot.

I've got a simple form that the user needs to fill out. In it, the user has to select a time and a date. I was planning on having them both done with drop down boxes. Two drop down boxes for the time (one with the hour, one with the minutes) and three for the date (one for the day, month and year).

So what's the easiest way of getting this done? For the times, I thought a FOR loop going from 00 to 23 for the hours, and 00 to 59 for the minutes. But I'm pretty stumped for the date. Is manually entering them into the drop down box selection the best way?

static pages are always faster than dynamic pages.

So you think it's best just to manually code them into the page?

[eluser]Michael Wales[/eluser]
For date, I would include a few text boxes that can not be edited (merely for display purposes) and use a JavaScript calendar to allow them to easily select the date - Yahoo has a great offering here.

For time, I think one text box with a little bit of intelligent parsing would work (accept both 1100 and 11:00).

Thanks for the replies.

Will give both your suggestions a go tomorrow morning, Walesmd. Smile

Theme © iAndrew 2016 - Forum software by © MyBB