随着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...
}
}
});
可以用日期选择器小部件来完成吗?
最佳答案
您可以使用引导日期选择器来解决此类问题。 链接如下。 https://bootstrap-datepicker.readthedocs.io/en/latest/#
关于javascript - 如何在 onClose 中使用日期选择器选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59189043/