Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

validate country wise phone code javascript

country_codes=['91-', 'UK-44-', 'SZ-268-22']
phone="91-123456789";

is_valid_number = country_codes.some(elem => phone.match('^' + elem));
console.log(is_valid_number );
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #validate #country #wise #phone #code #javascript
ADD COMMENT
Topic
Name
2+7 =