如何在onClose中使用datepicker选项

使用jQuery UI Datepicker Widget,我要检查用户是否在模糊时将特定的输入字段留空,如果是,则将日期值分配为 altField 的值。我的脑海里就这样...


$(selector).datepicker({
     dateFormat: 'yy-mm-dd',onClose: function (date) {
         if (!$(this).val()) {
         //at this point,how can I assign my date to be the value of altField: "#hiddenInput"
         } 
         else {
         //...I just carry along and do something with my date...
         }
      }
});

可以使用datepicker小部件完成吗?

hjj835913562 回答:如何在onClose中使用datepicker选项

您可以使用引导日期选择器来解决此类问题。 链接如下。 https://bootstrap-datepicker.readthedocs.io/en/latest/#

,

我的环境Bootstrap 3版本的Datetimepicker:4.17.47

$("#dateTimePicker").on("dp.hide",function (e) {
  console.log(e.date);
});
本文链接:https://www.f2er.com/2972733.html

大家都在问