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