In comp.lang.javascript message <11**********************@o11g2000prd.go
oglegroups.com>, Tue, 12 Jun 2007 10:11:46,
sa*************@googlemail.com posted:
>I would like to validate a date in a textbox on the onChange event.
The date must be in the format 01/01/2007
That's a really silly format. It could represent, in that order, 1st
Jan 2007 or Jan 1st 2007. Now consider the following day ... . Numeric
dates should be ISO 8601.
>I would like to use a regular expression to validate it but I'm not
very familiar with them. How can I do it ?
You can easily validate the pattern thus, but not *easily* the date
itself. However, validating the date itself after a pattern test is
trivial, once the principle is realised. See below.
It's a good idea to read the newsgroup c.l.j and its FAQ. See below.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.