Adding a place holder to date field

4 posts, 0 answers
  1. Chinonso
    Chinonso avatar
    48 posts
    Member since:
    Jan 2017

    Posted 15 May 2018 Link to this post

         Hi there guys, as the title states, i am try to add a placeholder  to a date field.

    <div class="form-group">
       @(Html.Kendo().DatePicker()
              .Name("DateReceived")
              .Format("dd-MMM-yy")
              .DateInput()
              .HtmlAttributes(new { style = "width: 90%", title = "DateReceived", placeholder="Enter A Date"})
        )
    </div>

     

    but regardless of what i do, it doesn't show the placeholder value. What can i do to remedy this?

     

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2491 posts

    Posted 17 May 2018 Link to this post

    Hello Chinonso,

    By default when DateInput is enabled it will render placeholder for each the date, month, and year automatically. Thus, in such scenario specifying another placeholder is not available. 

    If having the custom placeholder text is a must I can suggest removing the DateInput option from the configuration. This way the placeholder will be displayed in the DatePicker.


    Regards,
    Viktor Tachev
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Lisa
    Lisa avatar
    1 posts
    Member since:
    Oct 2020

    Posted 13 Oct in reply to Viktor Tachev Link to this post

    Hello Viktor,

    I have the same problem as Chinonso and was wondering if there is a workaround or anything now to get both functionalities working? Has anything changed in the past 2 years?

    Kind regards,

    Lisa

  4. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2491 posts

    Posted 15 Oct Link to this post

    Hello Lisa,

     

    I am afraid that currently showing an additional placeholder in the DateInput is not available out of the box.

     

    Having an additional placeholder over the one shown by the DateInput would likely be confusing for the end-user. In addition having another placeholder can interfere with the functionality of the component. 

     

    Regards,
    Viktor Tachev
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Back to Top