Kendo Validator shows "title" attribute value as Required message

4 posts, 1 answers
  1. Alex
    Alex avatar
    11 posts
    Member since:
    Nov 2015

    Posted 24 Apr Link to this post

    Hi everyone,

    I've got a ComboBox where I wanted to get tooltip on hover. I did it like the following:

    @(Html.Kendo().ComboBoxFor(m => m)
              .Filter("contains")
              .Placeholder(ViewData.ModelMetadata.DisplayName)
              .DataTextField("Definition")
              .DataValueField("Code")
              .HtmlAttributes(new { style = "width: 100%", id = fieldname, title= "Some example"})
              .BindTo((System.Collections.IEnumerable)ViewData[bindto]))

    When I hover the mouse on the ComboBox, it shows "Some example" but the real problem is where Kendo Validator message is also showing "Some example", before this I was getting like: This field is required. How can I fix this so it doesn't mix up the Title value with the required field message?

     

    Thanks,

    Alex

  2. Answer
    Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 27 Apr Link to this post

    Hello Alex,

    I wasn't able to reproduce the mentioned issue. A short video test is available here - http://screencast.com/t/DL4Ryci6p for your reference. I have modified the ComboBox / Server filtering demo like that:
    <div class="demo-section k-content">
        <h4>Find a product</h4>
        <form id="ticketsForm">
            @(Html.Kendo().ComboBox()
              .Name("products")
              .Placeholder("Select product")
              .DataTextField("ProductName")
              .DataValueField("ProductID")
              .HtmlAttributes(new { style = "width:100%;" })
              .Filter("contains")
              .AutoBind(false)
              .MinLength(3)
              .HtmlAttributes(new { required = "required", data_required_msg = "Select start time", style = "width: 220px", title="combo title" })
              .DataSource(source =>
              {
                  source.Read(read =>
                  {
                      read.Action("GetProducts", "Home");
                  })
                  .ServerFiltering(true);
              })
        )
     
            <br />
            <input type="button" name="name" value="click" onclick="triggerValidation(); return false;" />
        </form>
    </div>
     
    <script>
        function triggerValidation() {
            var validator = $("#ticketsForm").kendoValidator().data("kendoValidator");
            validator.validate();
        }
    </script>

    If you are not using the latest Kendo UI version - 2016.1.412, does upgrading to it help? Otherwise it would be better to reproduce the issue with the code above and then tell us what changes you have made, so that we can proceed further with the investigation.

    Regards,
    Danail Vasilev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 27 Apr Link to this post

    Hello Alex,

    I wasn't able to reproduce the mentioned issue. A short video test is available here - http://screencast.com/t/DL4Ryci6p for your reference. I have modified the ComboBox / Server filtering demo like that:
    <div class="demo-section k-content">
        <h4>Find a product</h4>
        <form id="ticketsForm">
            @(Html.Kendo().ComboBox()
              .Name("products")
              .Placeholder("Select product")
              .DataTextField("ProductName")
              .DataValueField("ProductID")
              .HtmlAttributes(new { style = "width:100%;" })
              .Filter("contains")
              .AutoBind(false)
              .MinLength(3)
              .HtmlAttributes(new { required = "required", data_required_msg = "Select start time", style = "width: 220px", title="combo title" })
              .DataSource(source =>
              {
                  source.Read(read =>
                  {
                      read.Action("GetProducts", "Home");
                  })
                  .ServerFiltering(true);
              })
        )
     
            <br />
            <input type="button" name="name" value="click" onclick="triggerValidation(); return false;" />
        </form>
    </div>
     
    <script>
        function triggerValidation() {
            var validator = $("#ticketsForm").kendoValidator().data("kendoValidator");
            validator.validate();
        }
    </script>

    If you are not using the latest Kendo UI version - 2016.1.412, does upgrading to it help? Otherwise it would be better to reproduce the issue with the code above and then tell us what changes you have made, so that we can proceed further with the investigation.

    Regards,
    Danail Vasilev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Alex
    Alex avatar
    11 posts
    Member since:
    Nov 2015

    Posted 03 May in reply to Danail Vasilev Link to this post

    Hello Danail,

    Thanks, it's working now.

    Best,
    Alex

Back to Top
UI for ASP.NET MVC is VS 2017 Ready