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

RadDatePicker and ASP.NET Required Field Validator Inconsistancies

5 Answers 868 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 21 Oct 2010, 02:01 AM
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.

5 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 26 Oct 2010, 09:04 AM
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
0
Martin
Top achievements
Rank 1
answered on 27 Oct 2010, 06:39 AM
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
0
Martin
Telerik team
answered on 27 Oct 2010, 02:07 PM
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
0
Rahul
Top achievements
Rank 1
answered on 08 Jan 2014, 09:25 AM
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
0
Shinu
Top achievements
Rank 2
answered on 09 Jan 2014, 03:35 AM
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.
Tags
Calendar
Asked by
Martin
Top achievements
Rank 1
Answers by
Martin
Telerik team
Martin
Top achievements
Rank 1
Rahul
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or