This is a migrated thread and some comments may be shown as answers.

Clear validation messages

6 Answers 699 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Luk
Top achievements
Rank 1
Luk asked on 13 Jan 2012, 09:08 AM
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.

6 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 13 Jan 2012, 10:59 AM
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!
0
Luk
Top achievements
Rank 1
answered on 13 Jan 2012, 11:04 AM
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.
0
Kjell
Top achievements
Rank 1
answered on 29 Feb 2012, 02:05 AM
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. 
0
Rosen
Telerik team
answered on 29 Feb 2012, 09:16 AM
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!
0
Craig
Top achievements
Rank 1
answered on 22 Apr 2013, 06:12 PM
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?
0
Rosen
Telerik team
answered on 23 Apr 2013, 05:36 AM
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!
Tags
Validation
Asked by
Luk
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Luk
Top achievements
Rank 1
Kjell
Top achievements
Rank 1
Craig
Top achievements
Rank 1
Share this question
or