Client-side validation failed

2 posts, 0 answers
  1. Ivan
    Ivan avatar
    3 posts
    Member since:
    Dec 2012

    Posted 14 Mar 2013 Link to this post

    I have problem with client-side validation.  Even after I set Culture and it shows proper date format, when I submit page client-side validation fires error "The field Datum očitavanja must be a date.". Here is my code in view:

    @model ISPIS.Models.TerenskiRezultatFK
    @section headCultureContent {
        <script src="@Url.Content("~/Scripts/")"></script>
    <script type="text/javascript">
        //set culture of the Kendo UI
        ViewBag.Title = "Create";
        Culture = "sr-Latn-RS";
    <div class="editor-label">
        @Html.LabelFor(model => model.DatumOcitavanja)
    <div class="editor-field">
        .Format("dd.MM.yyyy HH:mm")
        .HtmlAttributes(new { style = "width:220px" })
        @Html.ValidationMessageFor(model => model.DatumOcitavanja)
    Please for some instruction. Thanks!
  2. Vladimir Iliev
    Vladimir Iliev avatar
    2190 posts

    Posted 18 Mar 2013 Link to this post

    Hi Ivan,

    Most probably the server and the client cultures are different resulting in different formats for the validation and the dateTimePicker. Could you please provide runable project where the issue is reproduced - this would help us pinpoint the exact reason for this behavior. 

    Also I would suggest to check the "Grid Globalization" demo in the offline demos which comes with your KendoUI for ASP.NET MVC installation. 

    Kind Regards,
    Vladimir Iliev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top