DatePicker UI lacks input validation

Reference your demo at: https://razor.radzen.com/datepicker

  1. Why does it allow me to type in ABCD as a date? Could you include an option (within your component) to validate input upon key strokes to enforce input in a date format?

  2. I would love to see a PlaceHolder that get filled in as the user types, rather than disappears the moment a user types. Is this possible?

I am aware that the above could be written external to the component, it would be nice to see it integrated.

Hi @Datamast,

We will do our best to provide these features in some of our next releases.

@enchev Is there way we can track this feature?

Hi @KaurParminder,

No, there isn't a way to track this feature. To be honest I don't think we can implement it (at least validate as you type). The reason is simple - typing a single character (e.g. 1) is never a valid .NET Date. If we validated immediately and cleared the input then the user would never be able to enter a valid date. This is why the RadzenDatePicker validates the date on blur (when it normally triggers its change event).

If you don't want your users to be able to type dates then we can probably add a feature to disable typing e.g. AllowInput="false" - this would make the input readonly while the user would still be able to pick a date via the calendar.

1 Like

@korchev Its good to have this update where user will not be able to input values rather select from date/time picker

Any Update on this AllowInput="false"?

No, this has not been implemented yet. We will gladly accept a pull request for this feature.

1 Like

Hi, Just submitted one :wink: