单击按钮时,Bootstrap datetimepicker不显示

时间:2018-02-19 10:19:12

标签: twitter-bootstrap sharepoint onclick datetimepicker

我有一个bootstrap datetimepicker,我有这段代码:

<script type="text/javascript" src="/scripts/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="/scripts/moment.min.js"></script>
<script type="text/javascript" src="/scripts/bootstrap.min.js"></script>
<script type="text/javascript" src="/scripts/bootstrap-datetimepicker.*js"></script>
<link href="../../_layouts/16/STYLES/XXX/css/bootstrap/bootstrap3.min.css" rel="stylesheet" />
<link href="http://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/a549aa8780dbda16f6cff545aeabc3d71073911e/build/css/bootstrap-datetimepicker.css" rel="stylesheet"/>

 <div class="row">
    <div class="col-sm-4">
        <asp:Label ID="LabelValidoDe" runat="server" Text="Válido de:"></asp:Label>
    </div>
    <div class="col-sm-4">
        <asp:DropDownList ID="DropDownListValidoDe" runat="server"></asp:DropDownList>
    </div>
    <div class="col-sm-4">
        <div class="form-group">
            <div class='input-group date' id='datetimepickervalidode'>
                <input type='text' class="form-control" />
                <span class="input-group-addon">
                    <span class="glyphicon glyphicon-calendar"></span>
                </span>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(function () {
            $('#datetimepickervalidode').datetimepicker();
        });
    </script>
</div>

当我转到日历图标并点击它时,它没有显示任何内容,我不知道为什么。它将我的鼠标图标改为手形而不是箭头,但它没有显示任何内容。

任何人都可以帮助我吗?非常感谢!

修改

新代码,在DatGeoudon回答之后:

 <div class="row">
    <div class="col-sm-4">
        <asp:Label ID="LabelValidoDe" runat="server" Text="Válido de:"></asp:Label>
    </div>
    <div class="col-sm-4">
        <asp:DropDownList ID="DropDownListValidoDe" runat="server"></asp:DropDownList>
    </div>
    <div class="col-sm-4">
        <div class="form-group">
            <div class='input-group date'>
                <input id='datetimepickervalidode' type='text' class="form-control" />
                <span class="input-group-addon">
                    <span class="glyphicon glyphicon-calendar"></span>
                </span>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(function () {
            $('#datetimepickervalidode').datetimepicker();
        });
    </script>
</div>

1 个答案:

答案 0 :(得分:0)

您的ID #datetimepickervalidode是div的ID,但datetimepicker()需要输入。