I am using below code to validate entered delivery date should not be less than today date .. for that purpose I have done below like this ....

I am using custom validation using jquery ...

this is my model:

```
    [UIHint("Date")]
    [DeliveryDateCheck]
    [DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)]
    [Required(ErrorMessage="Required")]
    public DateTime? DeliveryDate { set; get; }

```

and this is server side code validation 

```
public class DeliveryDateCheck : ValidationAttribute, IClientValidatable
{
    protected override ValidationResult IsValid(object value, ValidationContext validationContext)
    {
        string errorMessage = "Delivery date should be today date or Greater";
        if(value != null)
        {
            DateTime dt = (DateTime)value;
            if (dt.Date < DateTime.Now.Date)
            {
                return new ValidationResult(errorMessage);
            }
        }            
        return ValidationResult.Success;
    }

    public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
    {
        ModelClientValidationRule mcvRule = new ModelClientValidationRule();
        mcvRule.ValidationType = "checkdate";
        mcvRule.ErrorMessage = "Delivery date should be today date or Greater";
        yield return mcvRule;  
    }
}

```

and this is client side validation 

```
  $(document).ready(function () {

    jQuery.validator.unobtrusive.adapters.add('checkdate', {}, function (options) {
        options.rules['checkdate'] = true;
        options.messages['checkdate'] = options.message;
    });

    jQuery.validator.addMethod('checkdate', function (value, element, params) {
        if (value) {
            var todayDate = new Date();
            var compareDate = value.Date;
            if (compareDate < todayDate) {
                return false;
            }
        }
        return true;
    });

});

```

but I am getting error like this ...

**Error**

```
 0x800a138f - JavaScript runtime error: Unable to get property 'value' of undefined or null reference

```

I can see the server side validation is working fine but not able to do client side validation
Would any one has idea why I am getting error at here.....

many thanks in advance