Question Detail

how to set country Code Pattern html

6 years ago Views 1363 Visit Post Reply

I want to set Validation in country code in HTML how can we do this??

Thread Reply


- 6 years ago

This code will accept all country code with + sign

<input type="text" pattern="[0-9]{5}[-][0-9]{7}[-][0-9]{1}"/>

Some countries allow a single "0" character instead of "+" and others a double "0" character instead of the "+". Neither are standard.