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

Validating DropDownList inside a form

1 Answer 333 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Jaap
Top achievements
Rank 2
Jaap asked on 08 Jun 2012, 11:30 AM
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

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 13 Jun 2012, 11:37 AM
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.


Greetings,
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!
Tags
Validation
Asked by
Jaap
Top achievements
Rank 2
Answers by
Alexander Valchev
Telerik team
Share this question
or