Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i Disable Bootstrap DatePicker

i am trying to Disable the Bootstrap Date picker by adding the property disable="true", text-box is now disabled. when clicking on text-box the date picker still works how can i fix this issue.

HTML

<div class="input-group" id="DateDemo">
    <input type="text" id="txtPatientDOB" name="dd" data-format="MM/DD/YYYY" placeholder="DOB" class="form-control" disabled="disabled" /> <span class="input-group-btn">
    <button class="btn btn-green" type="button"><i class="glyphicon glyphicon-calendar"></i></button>
    </span>
</div>

JS

 $("#txtPatientDOB").attr("disabled", true); 
like image 740
kannan D.S Avatar asked Jan 24 '26 22:01

kannan D.S


1 Answers

Try this :

Set date-disabled to "'true'" (all dates unclickable) and show-button-bar to "'false'" (buttons not visible).

<label>Date</label>
<p class="input-group">
    <input type="text" class="form-control" ng-model="dt"
       datepicker-popup="MM-dd-yyyy" is-open="opened" close-text="Close"
       show-weeks="true" show-button-bar="'false'" date-disabled="'true'" disabled />
    <span class="input-group-btn">
        <button class="btn btn-disabled" ng-click="open()">
            <i class="glyphicon glyphicon-calendar"></i>
        </button>
    </span>
</p>

or Try setting Disabled property to true :

$("#Date").prop('disabled', true);
like image 162
Cyclotron3x3 Avatar answered Jan 26 '26 14:01

Cyclotron3x3