在焦點上,我的選擇器創建了一個動態編號用於使用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