RadCalendar Q3 2008-> Getting error multiple times

2 posts, 0 answers
  1. murthy
    murthy avatar
    1 posts
    Member since:
    Nov 2010

    Posted 11 Nov 2010 Link to this post

    Hi,
    I am using RadDatePicker and have written the below given java script function to handle OnError event.
    Now if I enter 505050 as the input i am getting the error "Enter a Valid Date in YYYY/MM/DD Format" multiple times if I press the "Enter" key to close the alert dialog which is very annoying. 
    I am new to ASP.NET as well as Telerik controls. Please let me know what is going wrong.

    ASPX
    <telerik:RadDatePicker ID="dtmFromDt" runat="server" Width="100px"
       Visible="true" MinDate="1500/01/01" MaxDate="3000/01/01" DateInput-DateFormat="yyyy/MM/dd"                                                     Skin="WebBlue">
            <ClientEvents OnPopupClosing="OnPopupClosing"/>
    <DateInput  runat="server" EmptyMessage="YYYY/MM/DD" Visible="true" ClientEvents-OnError="ShowDateError" >                     </DateInput>
    <Calendar Skin="WebBlue" runat="server" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"                                                    ViewSelectorText="x">
    </Calendar><DatePopupButton HoverImageUrl="" ImageUrl="" />
    </telerik:RadDatePicker>
    JavaScript 
    function ShowDateError(sender, args)  
    {  
    alert ("Enter a Valid Date in YYYY/MM/DD Format");  
    sender.focus();   
    return false;
    }

    Please find attached image of code from a sample solution

    Regards,
    Murthy Meka
  2. Dimo
    Admin
    Dimo avatar
    8478 posts

    Posted 11 Nov 2010 Link to this post

    Hi Murthy,

    This issue is fixed in newer RadControls versions. In your case you can use a global Javascript variable as a flag to prevent multiple alerts from appearing.

    Kind regards,
    Dimo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top