jquery date validation

Posted by Srinivas673 under jQuery on 4/22/2011 | Points: 10 | Views : 9171 | Status : [Member] | Replies : 2
function validate_date(date) {
var pattern = new RegExp(/\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/);
return pattern.test(date);
the above function i use it allows mm/dd/yyy format. it allows month>12 and date>31 i want to restrict that one
please advice how to validate in jquery.




Responses

Posted by: Tijut2k on: 4/26/2011 [Member] Starter | Points: 25

Up
0
Down
I request you to avoid these kind of coding standerd.
You can use Jquery plugins for validating,restricting in any kind way you want.

advice you to use this link http://jqueryui.com/demos/datepicker /

this plugins have all the options of calendar events

Best Regard's
Tiju Thankachan

Srinivas673, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Virendradugar on: 8/11/2011 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi,

You can go through series of articles about the jQuery UI datepicker implementation with ASP.NET.. Worth reading...

http://jquerybyexample.blogspot.com/search/label/jQuery%20UI%20DatePicker

Thanks,
Virendra

Srinivas673, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response