javascript – href tel: how to be sure dialing correct from the end user (Multi country)-ThrowExceptions

Exception or error:

This question is about multi countries with tel:

User X is in Canada
User Y is in Argentina

In my web form, I have select for country code and input for the phone number.

User X (for his profile) will select Canada (for +1) and type his number.

*** Problem :
User Y consulting his profile will have a rendered

<a href="tel:+1xxxxx" />

this would work if user Y was in Canada or in the USA, but user Y is in Argentina

according to a phone dial
to compose from Argentina to Canada it is not +1, it’s +001

Is there a library or way to auto-detect and auto-adjust the origin phone vs the country of the visitor

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *