嗨,我一直试图获得一个引导日期选择器的日期,并一直能够,但它似乎触发了3次。注意:这不是jquery日期选择器,而是引导日期选择器。
使用这个日期选择器:https://github.com/eternicode/bootstrap-datepicker,而不是旧版的eyecon.ro。
$(".date-picker").on("change", function(e) {
contents = $(this).val();
id = $(this).attr('id');
console.log("onchange contents: " + contents);
console.log("onchange id: " + id);
});
HTML:
<input id="start_date" type="text" data-date-format="yyyy-mm-dd" class="date-picker form-control" />
除了更改之外,我还使用了其他一些选项,例如
$('.date-picker').datepicker().change(function(){};
但这并没有关闭日期选择器,希望有一个简单的解决方案。thx
https://stackoverflow.com/questions/22614041
复制相似问题