Disabling Text Input for Dates

4 posts, 1 answers
  1. Richard
    Richard avatar
    16 posts
    Member since:
    Dec 2007

    Posted 13 Mar 2008 Link to this post

    Hi

    I know you can hide the text input box for a datepicker using

    <DateInput style="display:none"></DateInput
    >

    How do I get the inputbox to display but not allow the user to enter a date but only allow them to pick a date from the pop up?

    Thanks

    Richard
  2. Answer
    Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 13 Mar 2008 Link to this post

    Hi Richard,

    You can use the ReadOnly property of the DateInput component to achieve the desired functionality.

    Hope this helps.


    Sincerely yours,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. The Oracle
    The Oracle avatar
    46 posts
    Member since:
    Aug 2012

    Posted 09 Jul 2008 Link to this post

    Is there a way to toggle ReadOnly from javascript?  There doesn't seem to be any property such as dateInput.set_readOnly(true).

    Thanks,
    Graeme
  5. The Oracle
    The Oracle avatar
    46 posts
    Member since:
    Aug 2012

    Posted 09 Jul 2008 Link to this post

    It turns out, I can use this work-around:

    1 function MakePickerReadOnly(picker)  
    2 {  
    3     picker.set_enabled(true);  //show an enabled style  
    4     var input = picker.get_dateInput();  //retrieves the inner DateInput portion of the DatePicker  
    5     input._textBoxElement.readOnly = true;  //the inner reference to the input object; changes appearance to "ReadOnly" style.  
    6 }  
    7  

    Graeme
Back to Top