prevent automatic date changing

3 posts, 1 answers
  1. Benjamin
    Benjamin avatar
    46 posts
    Member since:
    Apr 2009

    Posted 04 Oct 2009 Link to this post

    hi,

    Anyone know how to prevent automatic date recognition in datepicker even if i typed a wrong date.

    thanks.
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Oct 2009 Link to this post

    Hi Benjamin,

    Try the following approach and see whether it helps.

    ASPX:
     
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server">  
        <DateInput>  
            <ClientEvents />  
        </DateInput>  
    </telerik:RadDatePicker>  

    JavaScript:
     
    <script type="text/javascript">  
        Telerik.Web.UI.RadDateInput.prototype.parseDate = function(value, baseDate)  
        {  
            if (new Date(value) != "NaN")  
                return value;  
        }  
    </script>  

    -Shinu.
  3. Benjamin
    Benjamin avatar
    46 posts
    Member since:
    Apr 2009

    Posted 05 Oct 2009 Link to this post

    thanks Shinu. that did the trick.
Back to Top