Official Address: http://bassistance.de/jquery-plugins/jquery-plugin-validation/
Foot home http://www.jb51.net/jiaoben/17478.html
Due to project requirements, it is essential to have a serious date size, but the validation plug-in does not have this function. In this case, we need to extend a custom verification method, CodeAs follows:
Copy codeThe Code is as follows: $ (document). Ready (function (){
$ ("# <% = Btnsubmit. clientid %>"). Click (function (){
$ ("# Aspnetform"). Validate ({
Rules :{
Ctl00 $ contentplaceholder1 $ ucprojinfo1 $ ucdatepicker2 $ txtdatepicker :{
Required: True,
Date: True,
// Date comparison Verification Method
Enddate: True
}
}
});
});
// Custom Verification Method
Jquery. validator. addmethod ("enddate ",
Function (value, element ){
VaR startdate = $ ('# start_date'). Val ();
Return new date (date. parse (startdate. replace ("-", "/") <= new date (date. parse (value. replace ("-","/")));
},
"The end date must be later than the start date! ");
});