Hi ,
I am trying to validate a date picker if an invalid date is entered. It becomes red and with the help of script i can pop up an error meg but that still doesnt help me stop the page from being saved (ie postback). IS there any way i could make it work as the comparevalidator would work ie restricting the page from being posted back if the validation fails.
Or in my error script function how can i set the focus back to the control after the popup so that everytime the user tries to come out of the datepick with an invalid date i pop the error msg and the focus goes back to it.
Below is my code.
I am trying to validate a date picker if an invalid date is entered. It becomes red and with the help of script i can pop up an error meg but that still doesnt help me stop the page from being saved (ie postback). IS there any way i could make it work as the comparevalidator would work ie restricting the page from being posted back if the validation fails.
Or in my error script function how can i set the focus back to the control after the popup so that everytime the user tries to come out of the datepick with an invalid date i pop the error msg and the focus goes back to it.
Below is my code.
<
rad:RadDatePicker ID="DtGrid" runat="server" MinDate="2000-01-01" MaxDate="2014-12-31" DatePopupButton-ImageUrl="~/Images/calendar_small.gif" DatePopupButton-HoverImageUrl="~/Images/calendar_small.gif" SharedCalendarID="sharedCalendar">
<DateInput runat="server">
<ClientEvents OnError ="Error" />
</DateInput>
</rad:RadDatePicker>
and this my script
<
script language="javascript" type="text/javascript">
function
Error(sender, args)
{
alert ("Enter a Valid Date in MM/DD/YYYY Format");
}
</
script>
Any help appriciated.
Thanks