I want users to be able to change a Kendo UI Datepicker value only through its button and selecting the date from the pop-up. How can I prevent users from typing in the Datepicker textbox? Can I disable the textbox without disabling the whole control?
By default, the DatePicker is enabled. To disable the component, set its disabled property to true .
On your input element add this attribute and value...
onkeydown="return false;"
This will disable typed input and still allow using the calendar control input.
Use the control as below-
@(Html.Kendo().DatePicker() .Name("FromDate") .HtmlAttributes(onkeydown="javascript:return false;" }) )
It will disable keyboard typing. Same way other conditions also can be handled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With