ui.datepicker.js日历自动更新另一个日历时,日期更改
问题描述:
我使用ui.datepicker.jsui.datepicker.js日历自动更新另一个日历时,日期更改
在我的编辑表单我有2个日历有自己的功能。
日历答:是生成 日历乙发票日期:为下一个结算 日期Bill_freq是其中设置的帐单频率领域(每1个月,3个月,6个月,12个月)
我想要做的是,当日期为日历, 日历乙改变将是一个日期的基础上自动更新Bill_freq场。
感谢您的帮助!
答
尝试像onchange="$('#Calenderb').val($('#Calendera').val())"
答
$('#myCalendarA').datepicker({
//other options here
onSelect: function(dateText, inst) {
//pick the value you need
var billFreq = $('#Bill_freq').val();
//do some calculation with dateText (selected date in CalA) and billFreq
var newDate = dateText + billFreq; //beware date calc in JS is hard to master
//sets the date for Calendar B
$('#myCalendarB').datepicker('setDate', newDate) ;
}
});
嗨mnml, 如何设置Bill_freq值的日期基地? – lena 2009-11-10 19:28:30