Clear validation messages

7 posts, 0 answers
  1. Luk
    Luk avatar
    5 posts
    Member since:
    Jun 2010

    Posted 13 Jan 2012 Link to this post

    Hi,

    I run into some problem with validator control from Kendo. I use one form in dialog Window for adding and editing existing data. This form validates just fine, but since I use it more than once with various data I have to somehow clear validation messages for each new instance of editing window.

    It would be really nice to have a function like clearMessages()
    Right now I overcame this issue by taking validation messages into seperate <span> object and modyfing their HTML with jQuery.
  2. Rosen
    Admin
    Rosen avatar
    3237 posts

    Posted 13 Jan 2012 Link to this post

    Hi,

    You may hide the validation messages using a very simple jQuery selector, as demonstrated in this simple jsFiddle:

     

    All the best,
    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. Luk
    Luk avatar
    5 posts
    Member since:
    Jun 2010

    Posted 13 Jan 2012 Link to this post

    Yes, and it is exactly what I am doing right now :)
    I just post this as a suggestion, that such function would be nice, if it was built in control itself.
  5. Kjell
    Kjell avatar
    276 posts
    Member since:
    Jun 2010

    Posted 28 Feb 2012 Link to this post

    What is the best way to accomplish this when not using a kendoWindow?

    I just have a regular html page with a div which gets validated.  I have a button which clears all the fields, I would like to also hide any validation messages at that point. 
  6. Rosen
    Admin
    Rosen avatar
    3237 posts

    Posted 29 Feb 2012 Link to this post

    Hello Kjell,

    You should use the same approach as demonstrated in my previous message, but call the code when the button is clicked. For example:

    $("#clearButton").click(function() {
      $("#MyDivContainer").find("span.k-tooltip-validation").hide();
    });

    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!
  7. Craig
    Craig avatar
    2 posts
    Member since:
    Nov 2012

    Posted 22 Apr 2013 Link to this post

    OK, but it looks like Kendo documentation says there is a hideMessages() method to use for this.

    http://docs.kendoui.com/api/framework/validator#methods-hideMessages

    ... except that it doesn't work (at least in 2012.3.1315). Is this slated for actual support?
  8. Rosen
    Admin
    Rosen avatar
    3237 posts

    Posted 23 Apr 2013 Link to this post

    Hi Craig,

    The hideMessages is added with the Q1 2013 release of KendoUI. Therefore, it is not available in older versions of the library.

    All the best,
    Rosen
    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
Kendo UI is VS 2017 Ready