html5 input date with validation (simple pattern) June 23, 2017 <input type="date" name="mydate" oninvalid="this.setCustomValidity('My personal validation message')" placeholder="gg-mm-aaaa" pattern="\d{1,2}-\d{1,2}-\d{4}" value="" id="mydate" required="required" /> Read more