This is a migrated thread and some comments may be shown as answers.

Kendo.DatePicker dissapears after Invalid date validation

1 Answer 714 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Heather
Top achievements
Rank 1
Heather asked on 18 Jan 2013, 03:44 PM
Hi there,

We are experiencing an issue with the datepicker in IE 8, 9 and 10.

Steps to replicate:

1. Enter '15/31/2012' in the datepicker field.
2. Click on Save (do a post).  You should get the invalid date message.
3. Delete the invalid date.
4. Click Save again. The datepicker disappears.

The date picked disappears.  We tested on latest browser versions and this happens for IE and FF.  Chrome doesn't seem to show the "invalid date" message and the datepicker stays visible.

Let me know if you need any more info.

View:

[Required]
[Display(Name = "Effective Date")]
[DataType(DataType.Date)]
public DateTime EffectiveDate { get; set; }

Editor Template:

@model DateTime?

@(Html.Kendo().DatePickerFor(m => m)
    .Name("datePicker")

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 21 Jan 2013, 10:21 AM
Hello Taylor,

 
Here is a quote of the answer I posted in the support ticket opened on the same subject:
 

This described behavior is actually related to jquery.validate.js itself. Basically, the Date/Time picker widgets copy the CSS classes of the input element to the wrapper. Thus the styling is applied to the wrapper element too. Unfortunately the jQuery Validate hides the wrapper element, because of the "input-validation-error" class, although it is not an input or validation message element. The only workaround of this is to remove the validation error class on load of the widget:

Copy Code
@Html.Kendo().DatePickerFor(m => m).Name("datePicker")
 
<script>
$(function() {
     $("#datePicker").data("kendoDatePicker").wrapper.removeClass("input-validation-error");
});
</script>



Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Date/Time Pickers
Asked by
Heather
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or