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

Message only in tooltip

1 Answer 212 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 25 Jun 2014, 02:54 PM
Due to the size restrictions on my page, I would like to only show the validation icon beside each field and have the message within a tooltip of that icon.

In other words, is there a way to go from this (default generated):

<span class="k-widget k-tooltip k-tooltip-validation k-invalid-msg" data-for="Impact" role="alert">
   <
span class="k-icon k-warning"> </span> Impact is required
</
span>


To this:

<span class="k-widget k-tooltip k-tooltip-validation k-invalid-msg" data-for="Impact" role="alert">
   <span class="k-icon k-warning" title="Impact is required"> </span>
</span>

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 27 Jun 2014, 08:59 AM
Hello Jonathan,

You can customize the error message container rendering via the errorTemplate option.  For example:

<form>
  <input name="productName" required /> <br/>
  <button>Save</button>
</form>
<script>
  $("form").kendoValidator({
    errorTemplate: '<span class="k-widget k-tooltip k-tooltip-validation"><span class="k-icon k-warning" title="${message}"></span></span>'
  });
</script>


Regards,
Rosen
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
Jonathan
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or