Hello,
I am using JQuery validation to validate a form containing many controls in addition to 2 kendo controls. The checkboxgroup and a radiogroup.
After updating the project to 2022.1.119 from 2021.1.330 the validation on the form gets the following error:
Upon inspecting the error (this is inside of the jquery.validate.js file) i see that for only the two kendo controls, the $(element).rules() is evaluating to undefined and then when line 754 runs it errors because "rules" is nothing
My question is what changed to cause this? I only see very small tweaks to the HTML output of the core wrapped controls, im not seeing anything that would cause rules() to evaluate undefined.
Here is my JS for the validation setup:
var validateValue = $("#frmAdditem").validate({
errorClass: "error fail-alert",
validClass: "valid success-alert",
errorPlacement: function (error, element) {
//Custom position: first name
if ($(element).attr("name") == "chkAIWork") {
$("#lblChkAIWork").text(error[0].innerText);
}
else if ($(element).attr("name") == "rdoMatchType") {
$("#lblRdoMatchType").text(error[0].innerText);
}
else if ($(element).attr("name") == "dpAIReleaseBy") {
$("#lbldpAIReleaseBy").text(error[0].innerText);
}
else {
error.insertAfter(element);
}
},
rules: {
txtAIPart: {
required: true,
minlength: 2,
maxlength: 100
},
txtAIRev: {
required: true,
maxlength: 10
},
chkAIWork: {
required: {
depends: function (element) {
return !$("#chkAIWork").getKendoCheckBoxGroup().value() == '';
}
}
},
rdoMatchType: {
required: {
depends: function (element) {
return $("#rdoMatchType").getKendoRadioGroup().value() == undefined;
}
}
},
ddlAIProjectType: {
required: true
},
txtAIProj: {
required: true,
maxlength: 30
},
dpAIReleaseBy: {
required: true
}
},
messages: {
txtAIPart: {
required: "Part is required",
minlength: "Part should be at least 3 characters"
},
txtAIRev: {
required: "Rev is required"
},
chkAIWork: {
required: "Work selection is required"
},
rdoMatchType: {
required: "Match type is required"
},
ddlAIProjectType: {
required: "Type is required"
},
txtAIProj: {
required: "Project name required"
},
dpAIReleaseBy: {
required: "Release by required"
}
},
success: function (label, element) {
if ($(element).attr("name") == "chkAIWork") {
$("#lblChkAIWork").text('');
}
else if ($(element).attr("name") == "rdoMatchType") {
$("#lblRdoMatchType").text('');
}
else if ($(element).attr("name") == "ddlAIProjectType") {
$("#lblddlAIProjectType").text('');
}
else if ($(element).attr("name") == "dpAIReleaseBy") {
$("#lbldpAIReleaseBy").text('');
}
}
});
I'm aware there is a kendo validate but have never used it because JQuery validate was working fine before the upgrade
Can anyone help with this?
Thanks