Re: checking user input of MM-DD-YYYY

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Tue, January 15, 2008 9:02 am, Per Jessen wrote:
> Nathan Nobbe wrote:
>
>> i think this ties into the thread tedd started a week or so ago
>> about the best approach for collecting user data.
>> it would be much easier to validate if there were 3 text input
>> fields
>> to collect the data, rather than 1, free-form field.
>
> I would stick to one date field with a simple javascript validation
> (using a regex) at entry time followed by a semantic check that the
> given day exists in the given month/year.
> Of course, if you'd rather not use javascript, you could validate the
> whole thing after POST.

You have to validate after POST anyway; The JS can be bypassed/off.

JS validation is eye-candy and reduces strain on the server by legit
users.  It is in no way, shape, or form to be considered actual
validation of incoming data.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux