JavaScript For Checking Date
<pre><code>function checkDate(sender, args) {
                var toDate = new Date();
                toDate.setMinutes(0);
                toDate.setSeconds(0);
                toDate.setHours(0);
                toDate.setMilliseconds(0);
                if (sender._selectedDate &gt; toDate) {
                    alert("You can not select forthcoming days!");
                    sender._selectedDate = toDate;
                    sender._textbox.set_Value(sender._selectedDate.format(sender._format))
                }
</code></pre>

<p>I used this javascript to validate the date of the textbox. Its should only accept the all the past date and todays date. Future dates are not accepted. It works perfectly for past and future date. But when i select the todays date it do not accept. The logic is correct because selected date should be greater than todays date as i have given. Can any one give a suggestion on this.</p>
