Search code examples
html

HTML input type "time" not taking default value


I'm trying to use an HTML input element with type="time", but I'm getting unexpected results. I have two of these on a page, one of them works and one does not.

<td>
    <input type="time" class="uk-input" value="7:30:00" name="timein[]"/>
</td>
<td>
    <input type="time" class="uk-input" value="16:00:00" name="timeout[]"/>
</td>

The first element will be rendered blank, why?


Solution

  • 2 digits per number. Just add a 0 in front of 7. the format is hh:mm:ss.

    Here is doc.

    <input type="time" class="uk-input" value="07:30:00" name="timein[]"/>
    <input type="time" class="uk-input" value="16:00:00" name="timeout[]"/>