1
I’m having trouble with tags <input>
of the kind type="date"
, as shown below, when user uses Chrome (ie in Firefox 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 the value=""
when it receives an input-ready date, it returns in the wrong format when the user writes manually and adds an date Picker input I did not request.
Now, the obvious solution is to make the type text type="text"
, but according to HTML5 I could/should flag as date type type="date"
, because that is how it is.
Is there anything that I can do in my sources in order to fix or prevent this, in addition to setting input as text? This is my mistake?
In fact, that’s what I did. I changed the data inputs to
type="text"
and, as I already had both Jquery and a mask library in the project, I only had to write in Javascripst this link between the mask and the inputs. (Welcome to Stack Overflow)– C. Bohok