I want the date input to stop typing once the year has 4 digits. I tried using the min and max component from HTML, but it stills allows you to type erasing the first digit. See example 1.
See example 2 to see that year can be typed with more than 4 digits.
Here are my two test runs, I also tried creating a method with JS using the "onchange" component from HTML and I tried, but none of this seems to work...
https://fiddle.jshell.net/jaelsvd/98xww3qg/9/
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label>Example 1</label>
<input id="date1" type="date" min="1990-12-31" max="2050-12-30">
<br />
<label>Example 2</label>
<input id="date2" type="date" />
onkeypressJavaScript event. Theonchangeevent does not fire while you type inside the input.