In the demo above, the ProductName column has a validation rule to start with a capital letter:
$(document).ready( function () {
$.extend(true, kendo.ui.validator, {
rules: { // custom rulesproductnamevalidation: function (input, params) {
if (input.is("[name='ProductName']") && input.val() != "") {
input.attr("data-productnamevalidation-msg", "Product Name should start with capital letter");
return/^[A-Z]/.test(input.val());
}returntrue;
}
},
messages: { //custom rules messagesproductnamevalidation: function (input) {
// return the message textreturn input.attr("data-val-productnamevalidation");
}
}
});
});
Make the needed tests on your side:
Open the demo.
Edit a record.
Change the ProductName value so it does not start with a capital letter.
Observe the result.
I hope this achieves the desired result.
Kind Regards,
Anton Mironov
Progress Telerik
Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the onlyREPL playground for creating, saving, running, and sharing server-side code.