Merge Validation Rules After Initialization

2 posts, 0 answers
  1. Jaime
    Jaime avatar
    60 posts
    Member since:
    Mar 2013

    Posted 25 Mar 2013 Link to this post

    Initialization of the Kendo validator in shared file
    I am initializing my validator without rules from a shared file. I need to then add some rules for a separate file only when that file is used.
    var validatable = form.kendoValidator({
        validateOnBlur: false

    I need to add rules in a separate file that isn't shared
    The following code needs to be added from the separate file
                rules: {
                    radio: function(input) {
                        if (input.filter("[type=radio]") && input.attr("required")) {
                            return $("form").find("[name=" + input.attr("name") + "]").is(":checked");
                        return true;
                messages: {
                    radio: "Please select a status"

    How can I merge these rules to the existing validator validation code when that files is included?

  2. Alexander Valchev
    Alexander Valchev avatar
    2873 posts

    Posted 26 Mar 2013 Link to this post

    Hello Jamie,

    I am afraid that what you would like to achieve is not supported out of the box. Custom validation rules are defined once, during the initialization of the component. It is possible only to customise the existing validation messages by attaching data-[rule]-msg attribute to the corresponding input elements.

    Kind regards,
    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!
Back to Top