在焦点上,我的选择器创建了一个动态编号用于使用datepicker对象,只有datepickers的月份,年份和prev/next按钮不起作用。未被捕获缺少此日期选择器的实例数据
$(document).on('focus', ".gfield_list_container tr td:nth-child(2) input" , function(){
// Gforms doesn't give list fields new ids so we must do it ourselves to enable date picker to work
$(this).attr('id', makeid());
$(this).removeClass('hasDatepicker');
$(this).datepicker({ dateFormat: 'dd/mm/yy' });
});
这里看到:
我搜索周围一点点,发现这个:
$(this).live('focus', function(){
$(this).datepicker({
dateFormat: 'dd/mm/yy',
changeMonth: true,
changeYear: true,
yearRange: '1930:'+(new Date).getFullYear()
});
});
用这种方法我得先日期字段外单击,然后单击在它内部激活日期选择器。一旦它可见,而上一个/下一个按钮和几个月/年现在似乎功能正常,我仍然无法选择我需要的日期,并且月份不会超过三月?
,你可以创建一些小提琴或JSsnippet,所以这将是我们更容易帮助你吗? – yash