To don't allow DatePicker keyboard input

3 posts, 0 answers
  1. Christian
    Christian avatar
    4 posts
    Member since:
    Aug 2012

    Posted 01 Aug 2012 Link to this post

    Hi,
    I'm working with datepickers and I tried the following a while ago:

    $("#begin_date").attr('disabled','disabled');

    I tried this to disable the text input of a date. But I realized later that it also makes the attribute unavailable for the web server to use in my application. The server wasn't receiving the dates I was picking so I stopped using it.

    Is there anyway to disable that text input besides this method?
  2. John DeVight
    John DeVight avatar
    209 posts
    Member since:
    Jan 2010

    Posted 07 Aug 2012 Link to this post

    Hi Christian,

    What if you did the following instead?

    $("#begin_date").attr("readonly","readonly");

    Regards,

    John DeVight
  3. Kendo UI is VS 2017 Ready
  4. Vicente
    Vicente avatar
    2 posts
    Member since:
    Sep 2011

    Posted 31 Aug 2012 Link to this post

    What has worked for me is this instead.

    HTML
    <input id="f1" width="150px" />

    JS
    $("#f1").kendoDatePicker().data("kendoDatePicker");
    $("#f1").attr("disabled","disabled");

    Hope this helps someone. Cheers.
Back to Top