Validating DropDownList inside a form

2 posts, 0 answers
  1. Jaap
    Jaap avatar
    96 posts
    Member since:
    Oct 2012

    Posted 08 Jun 2012 Link to this post

    Validating a DropDownList (mainly the ' required' rule, most other rules are not applicable) will not work correctly when you build a dropdownlist using the SELECT element and when you create the validator on a container element (e.g. a form).
    It works when you call the Validate function (or on submit of the form), but it does not work when the dropdownlist looses the focus.
    Seems the onblur event is not triggerd for the dropdownlist?
    This is not a big problem for the required rule, but I want to implement a custom rule which I want to be triggered when the dropdownlist looses the focus.

    Regards, Jaap
  2. Alexander Valchev
    Alexander Valchev avatar
    2895 posts

    Posted 13 Jun 2012 Link to this post

    Hello Jaap,

    To achieve that you can hook up to the focusout event of the dropDown <span> element and trigger the validation manually. For example:

    If you are interested in the cause for the default behaviour you may take a look at this forum post.
    I hope this helps.

    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top