I would like to create a validation message only for dropdownlist.
I'd like to get the text value of label.
label is parent of kendo dropdownlist
var custom = function(input){
if(input.is("[data-role=dropdownlist]")){
if(Utils.isNullOrUndefined(input[0].value) || input[0].value.length === 0){
return true;
}
return input.data("kendoDropDownList").value();
}
return true;
}
rules.custom = custom;
messages.custom = function(input){
"Insert" + input.closest("label").text()
}
var validator = {
validate: function(){
$(".k-invalid:first").focus();
},
rules: rules,
messages: messages
};
return $("#form1").kendoValidator(validator).data("kendoValidator");
This solution doesn't work