Adding a place holder to date field

2 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
    2379 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.
Back to Top