gpt4 book ai didi

javascript - 滚动日期时间选择器 jQuery

转载 作者:行者123 更新时间:2023-12-03 03:35:11 24 4
gpt4 key购买 nike

我创建了这个表单:

<form action='' method='post'>
<fieldset>
<div class='form-group'>
<label>Customer:</label>
<input class='form-control' placeholder='' name='customer' type='text' readonly value='<?php echo $customerInfo['name'] . ' ' . $customerInfo['surname'];?>'>
</div>
<div class='form-group'>
<label>Assignment:</label>
<input class='form-control' placeholder='' name='assignment' type='text' readonly value='<?php echo $assignment['description'];?>'>
</div>
<div class='form-group'>
<label>Current state:</label>
<input class='form-control' placeholder='' name='assignment' type='text' readonly value='<?php echo $state['name'];?>'>
</div>
<div class="form-group">
<label>New state:</label>
<select name="selectValue" class="form-control" id="selectState">
<?php
foreach($allStates as $state){
$id = $state['id'];
$code = $state['code'];
$name = $state['name'];
echo "<option value=$id>$code - $name</option>";
}
?>
</select>
</div>
<div class="form-group">
<input class='form-control' id="datetimepicker" type="text">
</div>
<input class='btn btn-info btn-sm' name='requestClosing' type='submit' value='Update assignment'>
</fieldset>
</form>

结果如下:

Form

但是当我想选择一个日期并向下滚动页面时。日期时间选择器消失。这样就无法选择日期。

有人可以帮我解决这个问题吗?

最佳答案

希望这有帮助

使用选项closeOnWithoutClick .设置closeOnWithoutClick:false,同时设置closeOnDateSelect:true以在选择日期后关闭datetimepicker。

$("#datetimepicker").datetimepicker({
closeOnDateSelect:true,
closeOnWithoutClick:false
});

DEMO

关于javascript - 滚动日期时间选择器 jQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45896790/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com