Disable automatic validation

9 posts, 0 answers
  1. Maxim Konstantinovski
    Maxim Konstantinovski avatar
    3 posts
    Member since:
    Apr 2006

    Posted 14 Mar 2012 Link to this post

    Is there a way  to disable automatic validation? I want to validate manually by calling [validate()]. At present it creates red box around my input automatically when [blur] event is fired.
    Thanks,
    Max
  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 15 Mar 2012 Link to this post

    Hello Maxim,

    KendoUI Validator will automatically trigger validation only if it is hooked to a form element and the form is submitted. However, from the description you have given, it seems that the browsers's built-in validation is triggered (most probably in FireFox?). You may remove the FireFox built-in validation highlighting  by overriding the appropriate CSS classes for example: 

    input:invalid, input:-moz-ui-valid {
         box-shadow: none;     
    }

    Additional information on styling the browsers built-in validation can be found on the net, for example here.Greetings,
    Rosen
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Brian Vallelunga
    Brian Vallelunga avatar
    88 posts
    Member since:
    May 2008

    Posted 23 Mar 2012 Link to this post

    Is this really the case? I'm seeing automatic validation as well with a custom validation rule. I'd like it to trigger only on calling the validate method.

    Specifically, I'm validating if two fields are equal to one another, for password and password confirmation.
  5. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 26 Mar 2012 Link to this post

    Hi Brian,

    Could you provide a sample (using jsFiddle for example) test page in which the behavior can be observed.

    Regards,
    Rosen
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Kjell
    Kjell avatar
    275 posts
    Member since:
    Jun 2010

    Posted 01 May 2012 Link to this post

    In the demo site validation occurs on a field when you leave the field.

    For example, click in the first field, then click out of it, and a validation message appears.

    I'm not sure if Brian is asking about the same thing but I am interested in turning that off.
  7. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 02 May 2012 Link to this post

    Hello Kjell,

    You may prevent validation when input is blurred, by setting validateOnBlur option to false:

    $("#div").kendoValidator({ validateOnBlur: false })

    Greetings,
    Rosen
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Jark Monster
    Jark Monster avatar
    46 posts
    Member since:
    Jan 2012

    Posted 25 Feb 2013 Link to this post

    Is there an easy way to replicate this on a grid?

    I have 2 scenarios across multiple grids in my application I'd like to implement it for:

    1. Some columns needs to have validateOnBlur set to false
    2. All fields need to have it set to false

    Let me know if this would be better suited as its own thread, but it seemed sufficiently related.

    Thanks!

  9. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 26 Feb 2013 Link to this post

    Hi,

    I'm afraid that disabling the validation on blur is not supported.

    Regards,
    Rosen
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  10. Jark Monster
    Jark Monster avatar
    46 posts
    Member since:
    Jan 2012

    Posted 08 Mar 2013 Link to this post

    I found a work around for the grid not supporting disabling of validation on blur and figured I'd share it here.  It doesn't utilize validateOnBlur directly, but it does end up disabling it.

    In the grid's onEdit event function:
    .Events(e =>
    {
        e.Edit("onItemGridEdit");
    })
    The function to turn off validation for a specific field:
    function onItemGridEdit(e) {
        //if cell being edited is Description
        if (e.container.context.firstChild.id == "Description") {
            //turn off validation for this field (this time only)    
            e.sender.editable.validatable.validate = function ()
                   { return true; };
            e.sender.editable.validatable.validateInput = function (input)
                   { return true; };
        }
    }
Back to Top
Kendo UI is VS 2017 Ready