This topic is locked

How to capture invalid date entries

2/25/2010 3:43:35 PM
PHPRunner General questions
J
jack knowles author

Hi Forum,
I need a way to error check when a user enters an invalid date manually (rather then using date picker).
Let me explain further

In the month of February there are only 28 days. Therefore if i enter into my field 'start_date' 30/02/2010 then the database will simply contain zeros and subsequent view pages that contains the record and field will display an inaccurate date back to the user.
I need a way to check the number of days in a given month for the number of months in the year 2010, 2011 & 2012.
Thanks in advance
JK

J
jack knowles author 3/1/2010

Hi All,
Can anybody provide some advise.
JK

Sergey Kornilov admin 3/1/2010

Not really a PHPRunner question but Google points to quite a few examples of date validation functions.

Check this one for example: http://www.codewalkers.com/c/a/Miscellaneous-Code/PHP-Date-Validation-including-leap-year/