Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable manual input for JQuery UI Datepicker field? [duplicate]

People also ask

How do I disable UI datepicker trigger?

Datepicker has a built-in disable method for this you can use, which also disables the text input, like this: $("#datepicker"). datepicker("disable");

How do you make a datepicker field readonly?

$("#datepicker"). attr('readonly', 'readonly');

How do I restrict datepicker?

When Start Date is selected, then need to disable all the dates before selected start date + 4 days in end date datepicker. "minDate" option is our choice here. If end date is selected first, then disable all the dates after selected end date - 4 days in Start date datepicker. "maxDate" option is our choice here.


When you make the input, set it to be readonly.

<input type="text" name="datepicker" id="datepicker" readonly="readonly" />

I think you should add style="background:white;" to make looks like it is writable

<input type="text" size="23" name="dateMonthly" id="dateMonthly" readonly="readonly"   style="background:white;"/>