How to disable/strikeout previous date using AjaxToolkit CalenderExtender in asp.net 3.5
In my project, I开发者_开发技巧 have used CalenderExtender
(which comes with AJAX Control Toolkit) in my webpages.
Now, I want my calender to strikeout or disable the previous dates.
How can I do it in CalenderExtender
?
Please use the js as follow to Strike Out the Past Days:
function checkDate(sender, args) {
if (sender._selectedDate < new Date()) {
alert("You cannot select a day earlier than today!");
sender._selectedDate = new Date();
// set the date back to the current date
sender._textbox.set_Value(sender._selectedDate.format(sender._format))
}
}
精彩评论