I'm having problems with <input>
tags of type type="date"
, as shown below, when the user uses Chrome (ie in Firefox it works as expected).
<input name="dt_fim" id="dt_fim" type="date" placeholder="99/99/9999" value="<?=$dt_fim?>" maxlength="10" pattern="(0[1-9]|1[0-9]|2[0-9]|3[01])\/(0[1-9]|1[012])\/2[0-9]{3}" required>
Chrome discards value=""
when it receives a ready date for the input, returns it in the wrong format when the user types manually, and adds a date picker in the input I did not request.
Now, the obvious solution is to make the type be text type="text"
, but according to HTML5 I could / should flag as date type type="date"
, because so it is.
Is there anything I can do in my sources in order to fix or prevent this, in addition to setting the input as text? Is this a mistake of mine?