I am using the Bootstrap datatimepicker (https://eonasdan.github.io/bootstrap-datetimepicker/). I'd like to disable the datetimepicker on page load.
$(document).ready(function () {
$('#datetimepicker1').datetimepicker({
defaultDate: new Date(),
format: 'DD/MM/YYYY hh:mm:ss A'
});
});
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
I have tried $('#datetimepicker1').prop('disabled', true)
and $('#datetimepicker1').disable()
from (http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#disable). Neither work. So what is the best way to do it?
try the following code $('#datetimepicker1 > .form-control').prop('disabled', true);
please check the link https://jsfiddle.net/komal10041992/DTcHh/32829/