Can't clear date with readonly datetime picker
Can't clear date with readonly datetime picker

Hi, I'm having an issue with deleting values using backspace and delete keys in a readonly datetime picker. I've tried using the Jquery _clearDate but it doesn't work.
$('#elementid').keyup(function (e) {
if (e.keyCode == 8 || e.keyCode == 46) {
$.datepicker._clearDate(this);
}
})
I've been searching the forums and I can't seem to find one that solve my problem. Any help would be gladly appreciated.
Thanks!
This discussion has been closed.
Answers
If it's readonly, would you expect people to delete values? I'm not clear what the intention is.
Could you link to your page, please, so we can see the issue, or update this test case here.
Colin
Hi @colin,
Yes, I want the user to delete values even if i'ts readonly.
I resolved my issue by adding the .input()
editor.field('#elementid').input().on('keyup', function (e) {
if (e.keyCode == 8 || e.keyCode == 46) {
clear it
}
});
Thanks for the response though!.