I want to validate phone number like this
- 08xxxxxxxx
- 08xxxxxxxxxx
- 08xxxxxxxxxxxxx
first and second digit must be 08 and following with other digits minimum 10 digit and maximum 15 digit
I already tried this code
<form>
<input type="tel" name="no_hp" class="form-control" pattern="[0]{1}[8]{1}[0-9]" maxlength="15" oninvalid="this.setCustomValidity('Nomor telepon harus di awali dengan 08 dan minimal 10')" required>
<input type="submit">
</form>
in below video, I try to input 089 and it successes but try without minimum 10 digit
but in below video If I try to input wrong first number like 189 and then I update to right number same with first video 089, its still says number is wrong.
so why after I correct format the number (leading by 08), it still says number is wrong? how to fix that?

