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

RadDatePicker

1 Answer 58 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jake
Top achievements
Rank 1
Jake asked on 07 May 2008, 05:18 PM
I am trying to prohibit users from entering letters in the date picker. What is the preferred way of going about this without a javascript workaround?

Thank you.

1 Answer, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 07 May 2008, 08:33 PM
Jake-

Generally speaking, the RadDatePicker has a very powerful parsing engine that enables it to convert most date entry types (including letters) in to actual dates. That makes it a very flexible tool that can accommodate many users. For example, to enter the date "April 15, 2008" in the date picker, I can type:

April 15 or 4/15 or 4 15 or apr 15

The only time letters become a problem is if the DatePicker can't parse them. In those cases, you can use Validators to prohibit form submission until users solve the problem. Check out this online demo for help:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Calendar/
Examples/DatePicker/Validation/DefaultCS.aspx

If, though, you don't want any keyboard support, you can use JavaScript to force the calendar date picker or filter the allowed values on key press. I don't think there is a built-in property that will filter out letters, but it is definitely a good idea! I'll make sure this gets added to our idea list.

-Todd
Tags
General Discussions
Asked by
Jake
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
Share this question
or