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

RadDateInput Javascript Error

1 Answer 29 Views
Input
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 20 Apr 2012, 02:07 PM
I would like to use the RadDateInput in such a way that it only displays the short month followed by the full year, but only requires the entry of the month number and the short year. For example, a user can input 4/12 and it will display Apr 2012.

If I do something like:
<telerik:radDateInput ID="DateInput2"
runat="server"
DisplayDateFormat="MMM yyyy"
DateFormat="MM/yy">
</
telerik:radDateInput>
it throws an error in Javascript "SCRIPT5007: Unable to get value of the property 'Month': object is null or undefined"

Adding a 'd' somewhere into the DateFormat but keeping the 'MM/yy' first so that it reads something l ike 'MM/yy/d' will work how I want, however, if a user needs to edit a date, clicking into the field changes the text to 04/2012/[today's day number] which is confusing since the only data that is relevant in the field is month and year.

I find that this error actually gets thrown if you ever omit anything from the DateFormat; having only day and year, only day and month, or only month and year will cause this error to be thrown. Is there any way around this? Or is that a limitation based on the current design of the control?

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 21 Apr 2012, 09:27 AM
Hello David,

I checked your code and it works correctly.

my telerik version : Q1 2012


Thanks,
Jayesh Goyani


Tags
Input
Asked by
David
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or