DatePicker with custom format does not kendoValidate

4 posts, 0 answers
  1. Matt
    Matt avatar
    66 posts
    Member since:
    Apr 2012

    Posted 08 Oct 2015 Link to this post

    When I run kendoValidator.validate() on a form with the following, it fails to validate:

     

                    @(Html.Kendo().DateTimePickerFor(model => Value)
                        .Format("d MMMM yyyy at hh:mm tt")
                        .HtmlAttributes(htmlAttributes))​

    Shouldn't the kendoValidator know to look at the format? How should I get this to work?

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 12 Oct 2015 Link to this post

    Hello Matt,

    Try to override the mvcdate rule like described in the following article and see how it works:



    Regards,
    Viktor Tachev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Matt
    Matt avatar
    66 posts
    Member since:
    Apr 2012

    Posted 14 Oct 2015 in reply to Viktor Tachev Link to this post

    Overriding "kendo.ui.validator.rules.mvcdate" as described in the link causes all my fields to fail to validate.
  5. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 15 Oct 2015 Link to this post

    Hi Matt,

    Please ensure that the format set in the validator is the same as the one specified for the DateTimePicker. In case the issue persists please send us a sample project where the behavior is replicated. This will enable to examine the setup and look for what could cause the issue.

    Regards,
    Viktor Tachev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready