DisableDates - Manual keyed entry

6 posts, 0 answers
  1. Sunny
    Sunny avatar
    4 posts
    Member since:
    Apr 2015

    Posted 13 Jun Link to this post

    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?

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 15 Jun Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Sunny
    Sunny avatar
    4 posts
    Member since:
    Apr 2015

    Posted 15 Jun in reply to Konstantin Dikov Link to this post

    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).

  5. Sunny
    Sunny avatar
    4 posts
    Member since:
    Apr 2015

    Posted 15 Jun Link to this post

    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();
    });
  6. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 17 Jun Link to this post

    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
  7. Sunny
    Sunny avatar
    4 posts
    Member since:
    Apr 2015

    Posted 17 Jun in reply to Konstantin Dikov Link to this post

    Thank you! Looking forward to future releases.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready