0
我正在使用MVC 3. 我正在与DatePicker一起工作。在DatePicker中,我在多个文本框中使用年份范围。该代码是: -日期选择器具有数据属性的年份范围
$('#textbox1Id').datepicker({
changeMonth: true,
changeYear: true,
yearRange: -10:+10
})
现在我此样本变换成作为接受某些参数的函数: -
function initializeDatePickerWithChangingMonthYear(minYearRange, maxYearRange) {
$('.YearRangeDatePicker').datepicker({
changeMonth: true,
changeYear: true,
yearRange: minYearRange:maxYearRange
});
}
我想使用的数据属性来传递不同的不同范围文本框在同一视图中。我怎样才能做到这一点?
感谢
的一个问题是如何将它检测到被点击的文本框没有W' – vishal
'$(this)'将代表'当前文本框元素' –
让我试试这个。我会在几分钟内回复你。 – vishal