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

DatePicker and Validation

2 Answers 92 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jeremy Elbourn
Top achievements
Rank 2
Jeremy Elbourn asked on 15 Apr 2010, 08:57 PM
I am attempting to implement a number of RadDatePickers throughout an application. I am stuck, though, on performing validation the way I want it to work. The desired behavior would be to have a Validator attached to the DatePicker that prevents the page from posting back if the text in the DateInput is not a valid date, but does allow a post if the DateInput is empty. None of the standard ASP.NET validators seem to do the job because the DateInput appears empty to them whenever it has an invalid text. This behavior would be necessary on a number of different pages throughout the application, so individually handling each DatePicker with a CustomValidator would not be a desirable solution. Is there some solution that would work using the available validation tools, or would implementing a new validator type be the best way to accomplish this?

2 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 20 Apr 2010, 12:33 PM
Hello Jeremy,

Try the solution provided in this code library and see if it works for you.

I hope this helps.

Regards,
Iana
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
Jeremy Elbourn
Top achievements
Rank 2
answered on 20 Apr 2010, 02:28 PM
While this is what I was trying to do, the CustomValidator solution linked isn't ideal for application-wide deployment. At this point I've already written my own validation control to handle the situation.
Tags
Input
Asked by
Jeremy Elbourn
Top achievements
Rank 2
Answers by
Iana Tsolova
Telerik team
Jeremy Elbourn
Top achievements
Rank 2
Share this question
or