我希望datepicker選擇currentdate/today並顯示它而不是'dd-yyyy',而且我希望今天之前的日期不能選擇,請幫幫我!在jquery中使用日期選擇器,今天顯示
$(document).ready(function() {
$("#button_id").click(function() {
$('<div/>', {
id: "div_id"
}).append($('<input>', {
type: "date",
name: "someDate",
class: "date_id"
})).appendTo("#static_div");
$(".date_id").datepicker({
//i want the datepicker to select the currentdate/today and display it instead of'dd----yyyy'and moreover i wanted the date before today to be disabled from selection
});
});
});
這裏的鏈接到我的小提琴:
http://jsfiddle.net/L4reds/73pEN/1/
你不能有相同的ID不止一個對象,使用而不是css類。 :) –
你想讓它選擇一天,同時給你一個選擇?我不理解你的問題。 – RRikesh