I have a datepicker with input box. When clicking the box, the calendar widget (Bootstrap Datepicker) shows. I want to prevent that a user can type anything in the box, meaning he is forced to select from the calendar. How to do?
I tried using 'disable' but that disables it all.
<div class="input"><label for="date posted">Date posted</label>
<input class='datepicker' id="date-posted" name="date-posted" placeholder="Enter your date posted" required="" type="text"></div>
Just disable the keydown event:
<input onkeydown="return false" class='datepicker' id="date-posted" name="date-posted" placeholder="Enter your date posted" required="" type="text"></div>
Or if you are using that bootstrap picker then you can make the input readonly and enable the flag of enableOnReadOnly