For UK abbreviated dates, the following regex could be used for an HTML input pattern attribute, to enforce date-month-year format, where date is 1-31, month is 1-12, and year is 1930-1999...
(?:[1-9]|1[0-9]|2[0-9]|3[0-1])\/(?:1[0-2]|[1-9])\/(19[3-9]{1}[0-9]{1})
Apply the regex, add some CSS visual cues like so, and Bob's your uncle:
input::placeholder {
color: rgb(46, 163, 242);
font-style: italic;
}
input:focus {
box-shadow: 2px 2px 2px 0px rgba(0, 0, 0, 0.4) inset;
}
input:required:invalid, input:focus:invalid {
border: 2px solid rgb(255, 159, 159) !important;
background: white;
}
input:required:valid {
background: rgba(196, 255, 214, .5) !important;
color: black !important;
}
section.form-layout input {
width: 120px;
height: 27px;
border: 2px solid rgb(46, 163, 242);
border-radius: 5px;
text-align: center;
color: rgb(46, 163, 242);
transition: all .5s ease;
}
*:focus {
outline: none;
}
<section class="form-layout">
<p>Enter your DOB <span style="font-style: italic;">(dd/mm/yyyy)</span>:</p>
<input required id="dob-1" placeholder="Date of Birth" type="text" pattern="(?:[1-9]|1[0-9]|2[0-9]|3[0-1])\/(?:1[0-2]|[1-9])\/(19[3-9]{1}[0-9]{1})" autocomplete="off">
</section>