I created a HTML5 mock-up for a new page which would eventually become an editable form where users could update date fields. In plain HTML, I have something like this in the mock-up:

<input id="startDate" type="date" required runat="server">

In the final version, I have the above in a ListView with the date fields being populated from a DB:

        <div class="col-sm-6">
            <div class="form-field">
                <label class="rentalLabel">View Start Date</label>
                <input id="viewStartDate" type="date" 
                    required runat="server">

In the plain vanilla HTML version with type set to "date", the calendar pops up when the user focuses on the field, as desired. However, when I try to populate this field in the ListView the date being pulled from the DB does not appear, only "mm/dd/yyyy" and the calendar. If I remove the type="date" property, I get the date from the DB but lose the calendar?

What I would like to happen is to have the date from the DB appear, and the calendar pop up when a user focuses on that field to update the date? Any solution?

Related posts

Recent Viewed