How do I force date selection via the popup calendar for the datepicker control?

1 Answer 67 Views
DatePicker
Adam
Top achievements
Rank 1
Adam asked on 20 Jun 2023, 03:37 PM

How do I force date selection via the popup calendar for the datepicker control?

We would like to prevent keyboard entry because it allows entering values before the set min date.

 

Thanks,

Adam

1 Answer, 1 is accepted

Sort by
1
Accepted
Konstantin Dikov
Telerik team
answered on 21 Jun 2023, 11:24 AM

Hello Adam,

The DatePicker provides an option for defining custom date input and if the requirement is to prevent the keyboard input you can either disable the input element or just render the selected date in a simple DIV or SPAN element:

For your convenience, following is an example demonstrating how to render the date in a DIV element and allow the changing of the value to be possible only through the popup:

Hope this helps.

 

Regards,
Konstantin Dikov
Progress Telerik

As of R2 2023, the default icon type will be SVG instead of Font. See this blogpost for more information.
Adam
Top achievements
Rank 1
commented on 21 Jun 2023, 02:06 PM

This is a great solution. Thank you.
Tags
DatePicker
Asked by
Adam
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or