I am looking to create a field within a HTML form which allows the user to type a National Insurance number (Format example: AB123456A
) and nothing else.
I have looked around and found the below:
<input type="text" name="natin"
value="<?php echo"$nino";?>"
pattern="[A-Z]{2}[0-9]{6}[A-Z]{1}"
class="form-control" required>
However this allows me to type anything in, is there a way to restrict this?