I have decorated a property on a model with a RangeAttribute. After doing so I have noticed the following problems:
- After entering a valid date and then trying to submit the form, the client side validation indicates that the date entered falls outside the range.
- Entering ANY date by typing the date directly into the input element, when tabbing to another element causes client side validation to indicate that the date entered falls outside the range.
Here's how to reproduce the problem (at least on my machine):
- In the Telerik MVC demo application, decorate the OrderInfoDto.DeliveryDate with a range attribute. For example:
- Compile and then browse to the demo page for the datepicker/clientvalidation.
- To reproduce the first problem I observed:
- enter valid input into the 'Delay' and 'Order date time'
- enter a valid date using the picker (I chose 1-Jan-2011)
- click on the save button
- you will see that the validation message is displayed for the 'Delivery date' - this is incorrect as the date does fall within the range declared. You will also note that a post to the server did not occur ie client side validation stopped the post
- To reproduce the second problem I observed:
- type ANY date into the 'Delivery date' (I chose 1/1/2011)
- hit tab and you should see that the validation message is displayed for the 'Delivery date' - this is incorrect.
My setup is as follows:
Windows 7 prof (32 bit)
Region and and language - format English (United Kingdom)
Telerik MVC 2011 Q2
No other alterations to the Telerik mvc demo were made
I also tried to reproduce these problems on IE9 (9.0.8112.16421). I was able to reproduce the first problem, but not the second problem. In IE9 typing in a valid date and tabbing out of the input element, the date is considered acceptable ie no validation message is displayed.
I have attached a screen shot demonstrating the second problem. This is after typing in 1/4/2011 (US format) and pressing tab. I then opened the picker just to further demonstrate the date that has been entered.