1
function checkDate(sender, args) {
var toDate = new Date();
toDate.setMinutes(0);
toDate.setSeconds(0);
toDate.setHours(0);
toDate.setMilliseconds(0);
if (sender._selectedDate > toDate) {
alert("You can not select forthcoming days!");
sender._selectedDate = toDate;
sender._textbox.set_Value(sender._selectedDate.format(sender._format))
}
我用這個javascript來驗證文本框的日期。它應該只接受過去的日期和今天的日期。未來的日期不被接受。它適用於過去和未來的日期。但是,當我選擇今天的日期它不接受。邏輯是正確的,因爲選擇的日期應該比我給出的今天的日期更大。任何人都可以就此提出建議。用於檢查日期的JavaScript
好吧讓我看看 – Aaraadhana
非常感謝。 – Aaraadhana
@Aaraadhana不用擔心,如果問題解決了,請將我的答案標記爲「已接受」。 – David