![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.javascript archiveRe: dd/mm/yyyy Date Compare Problem
From: Dr John Stockton <jrs@merlyn.demon.co.uk>
Date: Fri Apr 28 2006 - 22:20:24 CEST
JRS: In article <1146231504.278277.155500@y43g2000cwc.googlegroups.com>
>I have a working script that converts a dd/mm/yyyy text box date entry
AFAICS, you do not. It converts "dd/mm/yyyy" to a Date Object, but
> and compares it to the current date, giving an error
Don't let your posting agent line-wrap; posted code should be directly
> var arrDate = oDate.value.split("/");
or
> var today = new Date();
> if (useDate <= today)
Should be args.IsValid = useDate <= today
>}
>function doDateCheckDod(dodTxtBx, dobLbl, args)
Repeated code should generally be put in a function. When that is done,
-- © John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 © <URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript <URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources. <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.Received on Mon May 1 05:26:16 2006 |