update jquery validation plugin dateISO javascript
Posted
by Ian McCullough
on Stack Overflow
See other posts from Stack Overflow
or by Ian McCullough
Published on 2009-08-17T21:34:33Z
Indexed on
2010/03/12
2:07 UTC
Read the original article
Hit count: 406
jQuery
|JavaScript
Right now...the dateISO method is as follows:
dateISO: function(value, element) {
return this.optional(element) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);
},
but ive noticed that when a user enters something like 1991-99-99 it sees it as a "valid date" when it obviously is not. How would i change this code to have it check if the month is 01-12 and the date is 1-31?
© Stack Overflow or respective owner