Popup on the DatePicker when MaxDate is hit

2 posts, 0 answers
  1. Steve
    Steve avatar
    1885 posts
    Member since:
    Dec 2008

    Posted 05 Mar 2010 Link to this post

    I have a user who's complaining it's confusing that they cant click to another month past a maxdate I set...is there a way to put a javascript alert telling them that?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Mar 2010 Link to this post

    Hello Steve,

    Attach OnCalendarViewChanging event to datepicker-calendar and try the following code in order to show alert when user trying to navigate to other month that is past than MaxDate.

    client side code:

        function OnCalendarViewChanging(sender, args) {  
            if (args.get_step() > 0 && sender.FocusedDate[1] == sender.RangeMaxDate[1]) {  
                alert('Cannot navigate to next month...!');  
            }  
        } 

    -Shinu.

Back to Top