Bootstrap datetimepicker在选择日期时没有自动关闭。当我从datetimepicker选择日期时,它应该关闭datetimepicker,但它没有关闭
答案 0 :(得分:0)
$('input.datum').datepicker({
autoclose: true
});

<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker3.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/locales/bootstrap-datepicker.de.min.js"></script>
<form action="#" method="post">
<label>Date:</label>
<input class="datum" type="text" name="vondatum" required>
<input type="submit" value="save">
</form>
&#13;
您需要为此添加autoclose。
$( "#datepicker" ).datepicker({
autoclose: true
});