我目前正在使用2個單獨的JQuery日期選擇器,我修改了格式以便能夠通過後端存儲在MySQL數據庫中。JQuery Datepicker獲取選定日期
<script>
$(function() {
$(".datepicker").datepicker({
inline: true,
showOtherMonths: true,
dateFormat: 'yy-mm-dd',
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
});
});
</script>
我的日期選擇在這裏稱爲
<input type="text" class='datepicker' name="datepicker1" />
<input type="text" class='datepicker' name="datepicker2" />
我一直在試圖讓選定的日期通過通過AJAX到PHP。我曾嘗試使用getDate函數,但沒有多少運氣。
$(「。datepicker」)。datepicker('getDate');
它會返回第一個字段的值,而不是兩個 –
見http://jsfiddle.net/arunpjohny/DpgLQ/1/ –