Date Picker - Differenciate between empty and garbage data entry

2 posts, 0 answers
  1. Shaun
    Shaun avatar
    16 posts
    Member since:
    Jul 2012

    Posted 13 Oct 2013 Link to this post


    In my application I have several optional date fields.   

    This is Great:  1/1/2001  (or any other valid date)
    This is fine too since it's not required: ""   (nothing)
    This is not ok and is Invalid:  "asdfasdfasdf"

    When data binding (I use knockout with kendoUI), and when listening to the change event, there seems to be no difference between empty text, and an invalid date that has been entered.   How can I differenciate between the two?

    I would like to display validation errors in the case of invalid data, or even just clear the date out when focus is lost would work as well.  

    I found a similar post which directed another individual here:   However that is using jquery validation which I'm not interested in bringing that in to solve this issue.

    Is there something obvious I'm missing here?    If it's relevant, I am using knockout and knockout-kendo libraries.


  2. Alexander Popov
    Alexander Popov avatar
    1434 posts

    Posted 16 Oct 2013 Link to this post

    Hello Shaun,

    Here is an example that uses custom Kendo UI Validator rule to display an error message in case the input is not a valid date string. 

    Alexander Popov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top