HTML
<form id="Create Schedule" class="form-horizontal">
<div class="control-group">
<label class="control-label">Date:</label>
<div class="input-group date" class="controls">
<input type="text" class="form-control" id="dateSchedule" readonly>
<span class="input-group-addon">
<i class="glyphicon glyphicon-calendar"></i>
</span>
</div>
</div>
</form>
JS
$('.input-group.date').datepicker({
keyboardNavigation: false,
format: "yyyy/mm/dd",
autoclose: true,
todayHighlight: true
});
答案 0 :(得分:0)
尝试初始化页面加载,如此......
$(document).ready(function() {
$('.input-group.date').datepicker({
keyboardNavigation: false,
format: "yyyy/mm/dd",
autoclose: true,
todayHighlight: true
});
});
答案 1 :(得分:0)
您必须将日期选择器放在输入标记上。
试一试:
$('#dateShedule').datepicker({
keyboardNavigation: false,
format: "yyyy/mm/dd",
autoclose: true,
todayHighlight: true
});