date input validation html code example
Example 1: how to set a date for type date inpt
<input type="date" id="start" name="trip-start" value="2018-07-22">
Example 2: javascript validate date
var date_regex = /^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$/;
if (!(date_regex.test(testDate))) {
return false;
}