使用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小部件完成吗?