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

Date Picker - Differenciate between empty and garbage data entry

1 Answer 196 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 13 Oct 2013, 11:20 AM
Greetings,

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: http://jsbin.com/ufimom/640/edit   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.

Thanks!
Shaun



1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 16 Oct 2013, 06:29 AM
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. 

Regards,
Alexander Popov
Telerik
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
Shaun
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or