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

Disabling Text Input for Dates

3 Answers 99 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 13 Mar 2008, 07:48 AM
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

3 Answers, 1 is accepted

Sort by
0
Accepted
Giuseppe
Telerik team
answered on 13 Mar 2008, 09:42 AM
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
0
The Oracle
Top achievements
Rank 1
answered on 09 Jul 2008, 03:56 PM
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
0
The Oracle
Top achievements
Rank 1
answered on 09 Jul 2008, 06:24 PM
It turns out, I can use this work-around:

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

Graeme
Tags
Calendar
Asked by
Richard
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
The Oracle
Top achievements
Rank 1
Share this question
or