RadDatePicker and ASP.NET Required Field Validator Inconsistancies

6 posts, 0 answers
  1. Martin
    Martin avatar
    4 posts
    Member since:
    Oct 2010

    Posted 20 Oct 2010 Link to this post

    I am using a RadDatePicker with a standard ASP.NET Required Field Validator control. Our users have reported what they believe is a bug in the way that these two controls work together to valdate and prevent post back of a page.

    To setup the situation, you need a RadDatePicker with the MaxDate and MinDate configured. So, lets say the MaxDate is 30/06/2010 and the MinDate is 01/06/2010.

    The scenario:
    1. Type an out of range date into the textbox part of the date picker - Required Field Validator is displayed, post back prevented.
    2. Type a valid date into the textbox part of the date picker  - Required Field Validator is not displayed, post back allowed.
    3. Re-type the out of range date into the textbox part of the date picker - Required Feild Validator is not displayed, post back allowed.

    We would expect the post back to be prevented because the date is out of range. We would expect the value of whatever the Required Field validator is validating to be cleared if the value entered is invalid. Unfortunatly, we can only use a required field validator in this particualar scenario because of design constraints.
  2. Martin
    Admin
    Martin avatar
    811 posts

    Posted 26 Oct 2010 Link to this post

    Hello Martin,

    I tried to reproduce the issue locally but without success. Attached to this message is a short video that shows the behavior I get. In addition I am pasting the code I used for testing. Please review it and let me know if I miss something.

    <asp:ScriptManager runat="server" ID="ScriptManager1">
    </asp:ScriptManager>
    <telerik:RadDatePicker runat="server" ID="RDP1" MinDate="2010-06-01" MaxDate="2010-06-30">
    </telerik:RadDatePicker>
    <asp:RequiredFieldValidator runat="server" ID="RFV1" ControlToValidate="RDP1" ErrorMessage="Error"></asp:RequiredFieldValidator>
    <asp:Button Text="Postback" runat="server" />

    Regards,
    Martin
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Martin
    Martin avatar
    4 posts
    Member since:
    Oct 2010

    Posted 27 Oct 2010 Link to this post

    Hi Martin,

    Thanks for the code and the Video. I tried creating a new project (VS 2008 > New Website) and added your markup to the default page but the behavour is not the same as in the Video. The page loads, I enter 20/06/2010 (I'm in Australian format, if that matters) and the page posts back as you would expect, and the same as your video. I then overtype with 20/05/2010 and I get an error message next to the control but the page does post back, I noticed in your video that it does not post back.

    I'm thought that it might be an old issue because we're still using version 2009.3.1103.35 so I tried the same scenario in the latest version (downloaded the trial). Sure enough, it doesn't post back after I overtype with 20/05/2010.

    Regards,

    Martin
  5. Martin
    Admin
    Martin avatar
    811 posts

    Posted 27 Oct 2010 Link to this post

    Hello Martin,

    Indeed you are correct that the 2009.3.1103 release has the reported issue. Note that it is fixed for the official Q2 2010 release (2010.2.713) as stated in its release notes.

    I hope this helps.

    Regards,
    Martin
    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
  6. Rahul
    Rahul avatar
    39 posts
    Member since:
    Jan 2014

    Posted 08 Jan 2014 Link to this post

    Hi Martin,
                       I am using RadDate Picker , i want to validation on it so  without date selection show error message on button click.

    Thanks,
    Rahul
  7. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Jan 2014 Link to this post

    Hi Rahul,

    Please try the following code snippet which works fine at my end.

    ASPX:
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server">
    </telerik:RadDatePicker>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="RadDatePicker1"
        ErrorMessage="Required">
    </asp:RequiredFieldValidator>
    <telerik:RadButton ID="RadButton1" runat="server" Text="Validate">
    </telerik:RadButton>

    Let me know if you have any concern.
    Thanks,
    Shinu.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017