[thelist] validating date strings with javascript

Tom Dell'Aringa pixelmech at yahoo.com
Thu Feb 20 13:33:07 CST 2003


><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
> Hershel Robinson <hershelr at netvision.net.il> wrote:
>
> Why not create a Date object and set it to the inputted date; then
> you can have JS test for you if it's a valid date as well.
> If it is valid, then you can extract the month, day and year and
> append them together in any format you like.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

Hm, well the problem is if they don't input it correctly - say they
input 1/1/2000 - I still haven't taken care of the 'leading zero'
problem, so I still don't know what the date is. For all I know its
1/12/000 and they forgot the 2 - especially if they didn't enter any
delimeters ala 112000...

Tom



=====
>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
http://www.pixelmech.com/
var me = tom.pixelmech.webDeveloper();

http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/



More information about the thelist mailing list