Skip to content Skip to sidebar Skip to footer

Html5 Input Type Date Is Sometimes Empty Value If Entered Incorrectly

There is a crazy thing with input type date. Here is my html: If I enter an invalid value, it will change to valid value automatically. But not always true. The max date is alway

Solution 1:

From documentation HTML Living Standard

The value attribute, if specified and not empty, must have a value that is a valid date string.

The value sanitization algorithm is as follows: If the value of the element is not a valid date string, then set it to the empty string instead.

Post a Comment for "Html5 Input Type Date Is Sometimes Empty Value If Entered Incorrectly"