压延机未显示

时间:2016-03-30 07:37:32

标签: javascript jquery html css twitter-bootstrap

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
});

2 个答案:

答案 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
});