This is a migrated thread and some comments may be shown as answers.

datepicker and required field validator

7 Answers 392 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 26 May 2009, 11:32 PM
Hi,
 I have a date picker and required field validator on a user control. The issue is if I click in the date input box and I click on the calendar popup button or even I just clicked anywhere on the page the "Error message is shown" before I click on the save button on the page.
 Is this the real behaviour? or Is there a way to solve the issue?
ascx:
telerik:RadDatePicker AutoPostBack="false" runat="server" ID="datepicker1" Skin="Web20new"
                        EnableEmbeddedSkins="false" MinDate="1900-01-01" Width="132px">
                        <DateInput runat="server" InvalidStyleDuration="100" DateFormat="MM/dd/yyyy" LabelCssClass="radLabelCss_Web20new"
                            Skin="Web20new" EnableEmbeddedSkins="False" ShortYearCenturyEnd="2039">
                            <InvalidStyle ForeColor="Red" />
                        </DateInput>
</telerik:RadDatePicker>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="datepicker1" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>

aspx:
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
..
End Sub

 Thank you

7 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 27 May 2009, 11:10 PM
HI,
 Can any one help please?

 Thank you
0
Pavlina
Telerik team
answered on 28 May 2009, 06:11 AM
Hi John,

From the provided information I am not able to replicate the issue. At this point in order to progress in the resolution of this matter it will be best if you open a formal support ticket and send us a simple runnable application that demonstrates this erroneous behavior. Thus I could do all my best to help you further in resolving it.

For more information about RadDatePicker validation, please review the following article:
Validation

Regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
John
Top achievements
Rank 1
answered on 28 May 2009, 11:47 PM
Hi,
 Sorry I was unable to submit the ticket. the versio I m using is 2008.1.515.20

My Code 

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Default.aspx.vb" Inherits="TelerikCalendar._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Telerik Calendar</title>
    <link href="Skins/Web20/Calendar.Web20new.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager runat="server" ID="scriptManager1">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <telerik:RadDatePicker AutoPostBack="false" runat="server" ID="datepicker1" Skin="Web20new"
                        EnableEmbeddedSkins="false" MinDate="1900-01-01" Width="132px">
                        <DateInput runat="server" InvalidStyleDuration="100" DateFormat="MM/dd/yyyy" LabelCssClass="radLabelCss_Web20new"
                            Skin="Web20new" EnableEmbeddedSkins="False" ShortYearCenturyEnd="2039">
                            <InvalidStyle ForeColor="Red" />
                        </DateInput>
                        <DatePopupButton CssClass="radPopupImage_Web20new" ImageUrl="Skins/Web20/Calendar/datePickerPopup.gif"
                            HoverImageUrl="Skins/Web20/Calendar/datePickerPopupHover.gif" />
                        <Calendar runat="server" TitleFormat="MMM yyyy" Skin="Web20new" NavigationPrevImage="Skins/Web20/Calendar/arrowLeft.gif"
                            NavigationNextImage="Skins/Web20/Calendar/arrowRight.gif" FastNavigationNextImage="Skins/Web20/Calendar/fastNavRight.gif"
                            FastNavigationPrevImage="Skins/Web20/Calendar/fastNavLeft.gif" ShowRowHeaders="False"
                            EnableEmbeddedSkins="False" NavigationNextToolTip="Next Month" NavigationPrevToolTip="Previous Month"
                            FastNavigationNextToolTip="Three Months forward" FastNavigationPrevToolTip="Three Months Back"
                            UseColumnHeadersAsSelectors="false" UseRowHeadersAsSelectors="false">
                            <SpecialDays>
                                <telerik:RadCalendarDay Repeatable="Today" Date="">
                                    <ItemStyle CssClass="radCalToday_Web20new" />
                                </telerik:RadCalendarDay>
                            </SpecialDays>
                            <FooterTemplate>
                                <div>
                                    &nbsp;&nbsp;&nbsp;&nbsp
                                    <asp:ImageButton CssClass="footertemplatetoday__Web20new" ID="IBToday" runat="server"
                                        OnClientClick="SelectToday(datepicker1); return false;" ImageUrl="~/Skins/Web20/Calendar/MonthYearTodayBtn.gif" />
                                    &nbsp;&nbsp
                                    <asp:ImageButton CssClass="footertemplatecancel__Web20new" ID="IBCancel" runat="server"
                                        OnClientClick="CancelPopup(datepicker1); return false;" ImageUrl="~/Skins/Web20/Calendar/MonthYearCancelbtn.gif" />
                                </div>
                            </FooterTemplate>
                        </Calendar>
                    </telerik:RadDatePicker>
                </ContentTemplate>
            </asp:UpdatePanel>            
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="datepicker1" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>
            <asp:Button ID="Button1" runat="server" Text="Button" /></div>
    </form>

    <script type="text/javascript">
           
function SelectToday(sender)
{
    var currentDate = new Date()
    var picker = $find(sender.id);      
    picker.set_selectedDate(currentDate);   
    picker.hidePopup();     
}
       
function CancelPopup(sender)
{
    var picker = $find(sender.id);
    picker.hidePopup();    
}   
  
    </script>

</body>
</html>

aspx.vb
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Response.Write(datepicker1.SelectedDate.ToString())
      
    End Sub
0
John
Top achievements
Rank 1
answered on 29 May 2009, 10:52 PM
Hi Pavlina,
 Can you please reply ?

Thank you
0
Pavlina
Telerik team
answered on 01 Jun 2009, 06:23 AM
Hello John,

I followed your scenario in order to replicate the issue but to no avail. Please find attache a simple runnable application that demonstrates the needed approach. Give it a try and let me know if it works as expected.

Best wishes,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Peter
Top achievements
Rank 1
answered on 26 Jun 2009, 11:36 AM
I've got a similar problem. The equired filed validators just not work. No reaction, they allow to post the page. The date compare validator works. But absolutely no checking for empty date. I did copy the example 1:1 into my project. And it is not working. The example page running from my localhost works. In our project we have RadControls direcotry copied directly with only a few controls inside. Do I miss something? Is something special required here to be available? Some script files or anything?

Thanks in advance!
0
Pavlina
Telerik team
answered on 30 Jun 2009, 04:15 PM
Hello Peter,

I am afraid that the provided information is not enough to determine what have caused the unexpected behavior. At this point in order to progress in the resolution of this problem I will ask you to open a formal support ticket, and send us the problematic implementation, for additional testing and review.

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Calendar
Asked by
John
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Pavlina
Telerik team
Peter
Top achievements
Rank 1
Share this question
or