I have the following control:
@(Html.Kendo().DatePickerFor(model => model.Attributes.DueDate) .HtmlAttributes(new { ID = "idSurvey_DueDate", @data_bind = "value: DueDate", @Class = "report-label datepicker surveyAttributesData", TabIndex = 3 }) .Min(DateTime.Now) )
And the following jquery:
$("#idSurvey_DueDate").kendoValidator({ rules: { dateValidation: function (e) { var currentDate = kendo.parseDate($(e).val()); // Check if date parse was successful if (!currentDate) { return false; } return true; } }, messages: { dateValidation: "Invalid Date!", min: "Date must not be in the past!" } });
When I check this and enter an invalid date, the message I receive is not what I expect. Instead, this field "Longitude must be a date". Where does this mysterious message come from and why does it not use the message property that I put in the validator? All I want is invalid date formats that cannot be resolved and that the date is not in the past. Therefore, a minimum must be observed.
validation kendo-ui kendo-asp.net-mvc kendo-datepicker
hyprsleepy
source share