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

date change event.

1 Answer 76 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Guillermo
Top achievements
Rank 1
Guillermo asked on 12 Sep 2012, 08:43 PM

hello,

I'm working with a kendo datepicker. I created the control with a change event option.

When i run the page, if i already have a date in the input and y modifie it by adding some text to the input the change event is not fiered.

EX:

1- run code
2- the input has "12/12/2010"
3- add some invalid text to the end ex: "12/12/2010asdasd"
4- the input text of the input now is "12/12/2010asdasd" 


the change event is not fiered.

When i do the same but instead of add text, select all the text with the mouse and then y wrote any thet to the input, the change event is fiered.

EX:

1- run code
2- the input has "12/12/2010" 
3- select the input text with the mouse and write "asdasd"
4- the input text of the control now is "asdasd" 

the change event is fiered. 

is this the proper behaviour??

Regards
Guillermo




1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 14 Sep 2012, 10:36 AM
Hi Guillermo, 


The described behaviour of the DatePicker is expected, because it succeeds parsing the string "12/12/2010asdasd" to the valid date "12/12/2010" which is the same date as the old value. Also if you submit the DatePicker with value "12/12/2010asdasd" in the input filed, the submitted value will be valid date "12/12/2010".

Please note that DatePicker is working in the following way:
  1. Try to parse the field value
  2. If succeed the value is compared to the old value 
  3. If the current value is different than the old value the change event is fired

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!
Tags
Date/Time Pickers
Asked by
Guillermo
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or