[英]JS, jQuery, how to dynamically update/refresh datepicker value after changing the input value
I'm trying to dynamically change the date picker value I'm changing the input value using Jquery but unfortunately, date picker value stays the same. 我正在尝试动态更改日期选择器值,正在使用Jquery更改输入值,但是不幸的是,日期选择器值保持不变。
You can see that the initial value is "19/06/2017" and after changing it shows the new value ("10/10/2017") in the text box but date picker still shows the previous date ("19/06/2017") 您可以看到初始值为“ 19/06/2017”,更改后的初始值在文本框中显示新值(“ 10/10/2017”),但日期选择器仍显示先前的日期(“ 19/06/2017”) 2017" 年)
I tried using $('.datepicker').datepicker('update', $('#doc_due_date').val());
我尝试使用
$('.datepicker').datepicker('update', $('#doc_due_date').val());
but still nothing changed 但还是没有改变
Is there a way update or refresh the date picker after changing the input value? 更改输入值后,是否可以更新或刷新日期选择器?
I read some answers regarding the same issue but seems like nothing worked, date picker still shows the initial value 我阅读了有关同一问题的一些答案,但似乎无济于事,日期选择器仍显示初始值
thanks in advance. 提前致谢。
ps I'm using bootstrap date picker ps我正在使用引导日期选择器
use this 用这个
$('#datepicker_id').datepicker({
onSelect: function () {
$('#data').text(this.value);
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.