Closed invaders-xx closed 4 years ago
You either need to utilize a masking plugin on the input (to force date input in the format defined for the datepicker) OR you need to completly disable any manual input on the datepicker field by adding a "readonly" attribute to it (which is my preferred method to use, as this also disables on-screen keyboards from appearing when viewing on mobile devices)
Hello, I tried to add readonly attribute, but unable to select the date : everything is disable. If you have a working example, it would be very appreciated. BR David
My apologies, I forgot that when the readonly attribute is defined on the field, you need to define the option of ignoreReadonly: true
for the .datetimepicker() initalization:
$('#dateField').datetimepicker({ ignoreReadonly: true });
Hope this helps!
Works fine! Many thanks.
if you select a date using the selector and then replace the date by alpha characters in the input field (i.e. : abcde), then it shows this error on console: TypeError: this._dates[b] is undefined
and the picker is not working anymore.
Many thanks for your feedback.