0

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?

2 Answers 2

4

this solution should work for you:

<input type="text" readonly="readonly">
Sign up to request clarification or add additional context in comments.

Comments

0

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>

1 Comment

well, that disables the function of the datepicker as well :/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.