Override validation message with custom icon

2 posts, 0 answers
  1. Nathan
    Nathan avatar
    3 posts
    Member since:
    Dec 2012

    Posted 26 Nov 2013 Link to this post

    Is it possible to replace the validation message with my own image? I would like to provide an image and set it's title to the validation message. If there is a way to provide a validation message template, that would be great.


    Thanks!
  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 27 Nov 2013 Link to this post

    Hello Nathan,

    You can modify the Validator's message appearance by modifying the errorTemplate option. Similar to the following:

    <form>
      <input name="firstName" required /><br />
      <button>Click Me</button>
    </form>
     
    <script>
      $("form").kendoValidator({
       //this is how the default template looks like
        errorTemplate: '<span class="k-widget k-tooltip k-tooltip-validation"><span class="k-icon k-warning"> </span> #=message#</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!
  3. Kendo UI is VS 2017 Ready
Back to Top