Reputation: 305
I have a text input
with a jQuery datepicker
to choose dates, and I don't want it to be a possibility to select the text inside of it if someone were to double click the box or so, how can I disable this?
unselectable="on"
&
user-select: none;
did not work for me, is there another way?
Upvotes: 0
Views: 2703
Reputation: 96
this solution should work for you:
<input type="text" readonly="readonly">
Upvotes: 4
Reputation: 2930
use a span/div
as a parent of the input control and on click of this element-show the datepicker
use disabled property on the input control:
<input type="text" disabled>
Upvotes: 0