0
$(".datepicker_1").datepicker({
numberOfMonths: 2,
showButtonPanel: false,
minDate: new Date('<?php echo $st_date_sh.' '.$st_month_sh.', '.$st_year_sh?> 00:00:00'), //line 88
maxDate: new Date('<?php echo $en_date_sh.' '.$en_month_sh.', '.$en_year_sh?> 12:00:00'), //line 88
showOn: "button",
buttonImage: "images/Cal.gif",
buttonImageOnly: true,
/*beforeShowDay:function(dt){
return [(dt.getDay()==0)?false:true];
},*/
onSelect: function(dateText, inst) {
var dt_txt = dateText.replace('-','/');
dt_txt = dt_txt.replace('-','/');
var tmp_dt = new Date(dt_txt);
if(tmp_dt.getDay()==0)
{
if(confirm("Are you certain you want to assign Sunday delivery date?"))
{
//$(this).closest("tr").find(".update_quote_row").click();
}
else
{
return false;
}
}
}
});
我想要做的是,如果用戶試圖選擇一個星期日,則應該顯示確認,並且只有在確認選擇後纔會填充關聯的文本框。但是,使用我的代碼,無論我確認還是取消,文本字段都會更改爲所選值,並且我需要阻止該字段。我不能簡單地將輸入字段設置爲空白,因爲如果用戶取消確認,可能存在不應該修改的現有值。如何防止填充文本字段的jquery ui datepicker?