When users have to enter dates on my forms, I always provide them with three
drop-down menus, for day (1-31), Month (1-12) and year (usually current
year, the next and the next, depending on the application).

Then I have three values on the next page ($_POST['day'], $_POST['month'],
$_POST['year']) which I can combine into a date format I like, or even into
a Unix timestamp.

With the addition of JavaScript, I COULD make sure that months with less
than 31 days could not have "non existent" days selected, but I prefer to do
all my validation server-side and spit the form back to them with their
current values.

I can't see the need for a pop-up, GUI callendar, or anything else.

Just let them select a start and end date via 6 drop-down menus, make sure
the date is correct, make sure the end date is after the start date, format
them however you want as strings, then insert them into your DB.


Justin French

on 21/06/02 1:51 AM, Kevin Meredith ([EMAIL PROTECTED]) wrote:

> Hi there.
> I have an app that requires users to insert an 'end' date.  The date is
> saved in MYSQL in the date format.  The problem is that the user input,
> which is not always reliable, has to be in the correct format.  I was
> wondering if there is a way to have a simple calendar option, either on the
> page on in a pop-up window, where a user can select a date which will then
> have the correct format to be inserted.  There is also other data being
> captured on this page so this preferably needs to be done without refreshing
> the page.
> Any ideas would be greatly appreciated.
> Thanks
> Kevin

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to