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

DisableDates - Manual keyed entry

5 Answers 50 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Sunny
Top achievements
Rank 1
Sunny asked on 13 Jun 2016, 07:50 PM

On my form, I disabled dates. However, when a user manually keys in a date that is disabled, it seems to clear the input. This then gets passed on to my custom validation rules as a "" (empty string) instead of the date entered. Is there a way to prevent the datepicker from clearing its input when the user keys a disabled date in?

5 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 15 Jun 2016, 11:56 AM
Hi Sunny,

Could you please refer to the answer in the support ticket that you have opened for the same issue. As I have mentioned in the ticket, there is inconsistency with the disabled dates and we will further look into it. 


Best Regards,
Konstantin Dikov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Sunny
Top achievements
Rank 1
answered on 15 Jun 2016, 01:07 PM

Hi Konstantin,

Received your reply in the ticket, thank you, I will try this out (attaching to the blur event and manually adding back the disabled date value).

0
Sunny
Top achievements
Rank 1
answered on 15 Jun 2016, 02:05 PM

Attaching to the blur event does not work; the onChange event fires first, and kendo's onChange handler will wipe out the input before the onBlur works.

Attaching to the onChange event did work; I used the onChange event to store the user input, and then put the value back into the input... but the kendo onChange handler then fired afterwards, changing it to blank, and then overriding my storage variable when my onChange handler reacted. The jQuery event object was slightly different when from user input instead of kendo event handler and I used the presence of a field to distinguish between the two. This feels like a brittle fix and I hope that the engineers decide to not to clear out the field so that the client-side validator can provide user feedback; in my case it is not a required field so the user may not notice when their date is deleted.

 

$('#StartDate').change(function (e) {
     if (e.bubbles) //This is specific to the user's change event.
                    startDateInput = ($('#StartDate')).val();
});
0
Konstantin Dikov
Telerik team
answered on 17 Jun 2016, 08:14 AM
Hello Sunny,

It seems that the preferred fix will be to keep the input in all cases. You could follow the progress of the item at the following link:
Once again, please excuse us for any inconvenience caused by this.


Regards,
Konstantin Dikov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Sunny
Top achievements
Rank 1
answered on 17 Jun 2016, 02:05 PM
Thank you! Looking forward to future releases.
Tags
Date/Time Pickers
Asked by
Sunny
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Sunny
Top achievements
Rank 1
Share this question
or