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

Validation incorrect when using Chrome

2 Answers 219 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
michel
Top achievements
Rank 1
michel asked on 10 Jun 2013, 07:45 AM
I'm using an EditorTemplate to render the DateTimePicker of kendo. Everything is working fine on Internet Explorer and Firefox, but when testing the site in Chrome, I always receive a validation error on a valid date. (see attachment)

This is my editor template
@model DateTime?
 
@(Html.Kendo().DatePickerFor(m => m).Format("dd/MM/yyyy").ParseFormats(new List<string> { "dd/MM/yyyy", "MM/dd/yyyy"}))
Inside the _Layout page we register kendo and set the specific culture.

<script src="/Virteo.Fidiem.Presentation.Mvc/Scripts/kendo/2013.1.514/cultures/kendo.culture.nl.min.js"></script>
<script type="text/javascript">
    kendo.culture("nl");
</script>
Any idea why I still get the validation error ?
Kendo version 2013.1.514.340

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 12 Jun 2013, 07:39 AM
Hello Michel,

 
I am not exactly sure, what cause the described different in the behavior, but I will suggest you check this help topic (Client validation fails with invalid date) for more information. In general, jQuery Validate cannot parse dates with "dd/MM/yyyy" formats and will show validation message.

Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jonathan
Top achievements
Rank 1
answered on 13 Jun 2013, 01:19 PM
Dear Georgi,

I have read the help topic and it says at the end [Quote] You can also use Kendo Validator, which supports validating internationalized dates[End Quote]

We are using the Kendo validator as you see in the following code:

$('#create-transit-document-window').on('click', '#CreateTransitRequestSubmitButton', null, function (e) {
                var form = $('#CreateTransitDocumentForm');
                var validator = form.kendoValidator().data("kendoValidator");
                e.preventDefault();
 
                if (!validator.validate()) return;
});
But still we get the error that the date is not valid.

Any idea why the kendo validator is not solving this problem as said in the help topic?

Thank you

Regards

[SOLVED]
Forgot to set the kendo.culture so it took always the default culture to parse the date.
[/SOLVED]

Tags
Date/Time Pickers
Asked by
michel
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or