if you don't want the user to input trash, don't give him the opportunity.

on your form, put three two character input fields. label the fields month, 
day and year, or what ever is the most common order that your user will 
input a date.  put '-' or whatever, between the fields - just to make them 
look pretty.

now you get three fields back. each of which must contain a one or two 
digit number (don't worry about the year 2100 problem; neither you, your 
computer or your sfw will be here).  checking for numbers is real easy. in 
fact, i would do the checking on the client side in javascript.

yeah, you have to do a little more work in tearing apart and putting 
together dates and times. but this is a simple function.

hth  - obligatory strings mysql, database, sql

At 03:18 AM 8/16/01 -0700, you wrote:
> >
> > On Thu 16. August 2001 08:33, Van wrote:
> > > Greetings:
> > >
> > > Building a web form.  There are 3 datetimes:  RequestDate, 
> FulfillDate, and
> > > CancelDate.
> > >
> > > New record populates a web form with the current date/time in yyyy-mm-dd
> > > hh:mm:ss format.  RequestDate is current date, FullFillDate and 
> CancelDate
> > > are "0000-00-00 00:00:00".
> > >
> > > Updates present them with a record with the yyyy-mm-dd hh:mm:ss 
> formatting
> > > directly selected from the mysql_query.
> > >
> > > If the end-user doesn't manipulate the dates, all goes fine.  Just 
> updates
> > > the record with the current values in the web form.
> > >
> > > If they want to change one of these dates, they might be inclined to put
> > > slashes in their dates rather than hyphens.  They also might want to just
> > > put the day and the month (no time and no year).
> > >
snip
_________________________________________________________________________________
tom marlin
tjmarlin@<nospam>surfree.com
My mind wanders a lot; sometimes it leaves completely.
                  - Duncan Hill


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to