Kendo Textbox Helper

5 posts, 0 answers
  1. MiracleMan
    MiracleMan avatar
    11 posts
    Member since:
    Aug 2015

    Posted 09 Sep 2015 Link to this post

    Hello all, 

     I'm evaluationg the controls for my application and I'm currently stuck in something really stupid.  I'm using the Kendo Textbox helper and added the required attribute like this:

     

    @(Html.Kendo().TextBox()
             .Name("LastName01")
             .HtmlAttributes(new { placeholder = "Apellido Paterno", required = "required", validationmessage = "Enter {0}", @class = "col-sm-2 form-control" })
                )
    <span data-for='LastName01' class='k-invalid-msg'></span>

     

    But the position of the valition message is off, how can I get it under the textbox?  Attached is the screen shot.

  2. MiracleMan
    MiracleMan avatar
    11 posts
    Member since:
    Aug 2015

    Posted 10 Sep 2015 in reply to MiracleMan Link to this post

    Any help?
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Plamen Lazarov
    Admin
    Plamen Lazarov avatar
    135 posts

    Posted 11 Sep 2015 Link to this post

    Hello MiracleMan,

    When a validation message container is added manually (as in your case), Kendo UI does not apply any positioning styles to it by design. The idea is that the developer would position that element, according to the specific scenario and context. That being said, you can either wrap it in a block element (if applicable) or use custom CSS to position the validation message container at the desired position.

    Regards,
    Plamen Lazarov
    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. MiracleMan
    MiracleMan avatar
    11 posts
    Member since:
    Aug 2015

    Posted 11 Sep 2015 in reply to Plamen Lazarov Link to this post

    i dont understand, sorry.   When you say "validation message container", do you mean the span ?  I added that one after reading another article.  The problem persist even if I remove it. All in the same location. It is applying a k-tooltip class and a custom style with a margin of .5em somewhere.  If I modifiy my stylesheet, it wont allow me to overide it because of the manual style that somewhere is getting.  The span does not shows anywhere, it creates a div an the me validation messages goes into that div.

     

    Thanks for any help.

  6. Plamen Lazarov
    Admin
    Plamen Lazarov avatar
    135 posts

    Posted 15 Sep 2015 Link to this post

    Hello MiracleMan,

    Yes, by validation message container I mean the <span> element. Ideally, the Kendo UI Validator places its tooltips next to the validated input. I noticed that in the provided screenshot there is not enough space for the validation message container (i.e. the <span>) and this breaks the layout.

    As mentioned before, manually added validation message containers should be positioned with custom CSS by the developer, according to the specific scenario. However, as an exception, if you send us a runnable project, we can suggest how to achieve the desired positioning.

    Regards,
    Plamen Lazarov
    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
Back to Top
UI for ASP.NET MVC is VS 2017 Ready