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

Making Component border red on validation fail

1 Answer 1390 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Venkata
Top achievements
Rank 1
Venkata asked on 04 Oct 2014, 11:58 AM
Hi,

As per our requirement we need to show the component border to red when the component validation fails. Right now when the validation fails kendo is adding a span to the component. I don't need that message or a tool tip. I need to make all the fields which are invalid with red border and make the first error field focusable.

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 08 Oct 2014, 07:02 AM
Hi Venkata,

I answered to the support thread opened on the same subject. I would ask you to continue our discussion in only one thread to avoid any duplication. Thank you for the understanding.

Here is a quote of the answer I've posted in the support ticket:

The desired behavior can be accomplish with CSS rule that will hide the validation messages:
<style>
  .k-tooltip-validation {
    visibility: hidden
    // or
   //display: none !important;
  }
</style>

The Kendo UI validator applies "k-invalid" class to the invalid html elements. You can style it to show red border like this:
.k-widget > span.k-invalid,
input.k-invalid
{
  border1px solid red !important;
}

Here is a Dojo demo, that applies those styles and also uses MutationObserver to update the correct widget elements.


Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Validation
Asked by
Venkata
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or