0
我試圖創建1個或2個或更多的datepicker。jquery-ui-datepicker只更新第一個輸入
我已經創建了一個jQuery代碼來做到這一點,但是當腳本被執行時,兩個輸入元素都會打開一個日期選擇器,但只有第一個被更新。
當我點擊第二個日期選擇器時,第一個輸入被編輯。 有什麼幫助嗎?
是jQuery代碼:
$(".datepicker").each(function(){
var max = "+0";
if(typeof($(this).data('limit')) != 'undefined'){
max = $(this).data('limit');
}
$(this).datepicker({
yearRange: '-100:'+max,
dateFormat: "dd-mm-yy",
maxDate: max,
showButtonPanel: true,
changeMonth: true,
changeYear: true,
});
});
謝謝!
嗨讓菲利普請添加你的html代碼(並把它們放在一個jsfiddle例如,以幫助人們試圖解決你的問題) –