dimanche 1 septembre 2019

HTML5 phone number validation with pattern start with "05" [duplicate]

I'm using HTML5 form validation to validate phone numbers.

Phone numbers 10 digits long, and start with only "05".

For example:

0501234567,
0521234567,
0531234567.

I want to use patter for only character start with "05", tried pattern of [05][0-9] and it seems it not work. what do i need to change?

Tried this:
<input type="text" pattern="[05][0-9]" >

Thanks.

1 commentaire: