I am having a problem with a form on our site. I recently made an Auto-Formatting script for the form and and put requirements in, but if a user auto-fills it jumps pass the requirements and won't format since its done via keystroke
I tried below
<input type="text" onkeydown="phoneNumberFormatter()" class="form-control phone-number" id="phone-number" pattern="[1-9]{1}[0-9]{9}" maxlength="14" name="phone" placeholder="*Phone Example: ###-###-####"
oninput="setCsutomValidity('')"
oninvalid="this.setCustomValidity('Not Valid')"
onchange="try{setCustomValidity('')}catch(e){}"
required>
but this only worked on keystrokes and not autofill