I have a jquery Datetimepicker and i want to disable the keyboard input. I want only edit this field over the picker (Modalbox).
You should disable keyboard on your input like this:
$(function() {
$('#datepicker').keypress(function(event) {
event.preventDefault();
return false;
});
});
And Here is a working fiddle.
readonly
attribute on the text input should work for you, use this property in input field either by manually entering or you can set this attribute using Javascript or jQuery.
Set a text field to read-only using Script:
document.getElementById("myText").readOnly = true;
Or in HTML:
<input type="text" name="textName" placeholder="Select date" readonly>
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