Patel Tejas
Patel Tejas

Reputation: 202

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?

Upvotes: 0

Views: 937

Answers (1)

Chenthil
Chenthil

Reputation: 326

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))
            }
        }

Upvotes: 1

Related Questions