Invalid input produces undesired behavior

2 posts, 0 answers
  1. Chris Jones
    Chris Jones avatar
    13 posts
    Member since:
    Sep 2009

    Posted 10 Feb 2010 Link to this post

    If an invalid time number is entered, like 2900, the entry is nulled.
    If text is entered into a time value, like "asdf", a value of 12:00 AM is used.

    Both of these cases can be seen here:

    My question is the different defaulting of values (null and 12:00 AM) a bug?  I would hope that all invalid data entry would produce the same output (preferably null).

    Also, a nice to have would be to have a Validation error thrown for invalid input.

  2. Konstantina
    Konstantina avatar
    2332 posts

    Posted 12 Feb 2010 Link to this post

    Hi Chris,

    Thank you for contacting us.

    This is the expected behavior of the DatePicker. There are two cases:
    1. When you enter invalid digits, then the DatePicker returns null.
    2. When entering something other than digits the DatePicker returns the first hour.
    If you want when entering invalid value always to return null, you can use the LostFocus event and clear the value there.

    If you have further questions please feel free to contact us again.

    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.
Back to Top