Let\'s say I have a custom AddMethod to jQuery Validate like:
$.validator.addMethod(\'min-length\', function (val, element) {
// do stuff
// the error m
late to the party here, but this seems to work for me:
jQuery.validator.addMethod("minDate", function(value, element, param) {
var inputDate = new Date(value);
return (inputDate >= param)
}, function(param, element) {
return 'Enter a date greater than or equal to ' + $.datepicker.formatDate("M d, yy", new Date(param));
});
where the minDate value has previously been set on the control to validate something like this:
$('form:first').validate({
rules: {
"date-filed": {
minDate: new Date(2000,0,0)
},
...