Brief
Validate a UK Mobile Phone Number field in a HTML Form to take into account the following rules:
- Phone Number must begin 07
- Phone Number must not exceed 11 Digits
- Spaces are allowed (ignored). I've found that Auto-Fill features sometimes save numbers like 0123456789 or 01234 456 789. I'd rather not cause the inconvenience to the user to reformat their auto-fill input.
Valid Input Examples
- 07234567890
- 07234 567 895
- 07 23 45 78 90
Where I am
So far, I've only been able to validate my second point using:
<input id="phonenum" type="tel" pattern="^\d{11}$" required >