Form input javascript

Im trying to make a simple form and want a number input for swedish social security ID
The format is YYYYMMDDXXXX

So max lenght 12 and min length 12.

 <input type="number" min="0" pattern="\d{11}" oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"
    maxlength = "12" placeholder="Personnummer" name="frmPID" value="<? echo $rowFName; ?>" required>
Sponsor our Newsletter | Privacy Policy | Terms of Service