当setDate
事件触发第一个文本元素时,我可以onSelect
另一个文本元素吗?
我尝试用这种方式编码,它不起作用:
$( "#datebilled" ).datepicker({
showOn: "both",
buttonImage: "images/calendar.gif",
buttonImageOnly: true,
changeMonth: true,
changeYear: true,
beforeShowDay: noWeekendsOrHolidays,
onSelect: function(date) {
if ($('#cat option:selected').text() == "ABC") {
var date_billed = $('#datebilled').datepicker('getDate');
var date_overdue = new Date();
var weekDays = AddBusinessDays(45);
date_overdue.setDate(date_billed.getDate() + weekDays);
date_overdue = $.datepicker.formatDate('mm/dd/yy', date_overdue);
//setDate of date overdue
$('#datepd').datepicker('setDate', date_overdue);
}
}
});