I have 9 DropDownListFor that cascades from other DropDownList. I need to disable validation for DropDownLists that has no items. How to do it ?
1 Answer, 1 is accepted
0
Alexander Valchev
Telerik team
answered on 18 Jun 2013, 09:15 AM
Hello Sebastian,
Kendo Validator works on the basis of HTML validation attributes. In order to disable/remove a given validation rule, you can remove the corresponding attribute from DropDownList element.
Please hook up to the dataBound event of the widget and remove the validation attributes if there is no data in the dataSource. For example:
onDataBound: function(e) {
if(this.dataSource.data().length == 0) {
this.element.removeAttr("required");
}
}
I hope this will help.
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!