osmlab / onosm.org

An easy way to put your business on OSM.
The Unlicense
73 stars 61 forks source link

Ensure country code is added to phone number #94

Open tastrax opened 3 years ago

tastrax commented 3 years ago

It would be useful to validate if the phone number has the country code before submitting to OSM. There is a worldwide push to get numbers corrected. https://maproulette.org/browse/challenges?query=phone

le-jun commented 3 years ago

As long as the number isn’t added as it is into OSM but only creates a note I classify this issue as minor. On the other hand while the "phoneplaceholder" do a pretty good job at hinting the country code I agree that a validation may be necessary. A simple way to do that would be to verify if a + sign is added in the form as there’s a low chance of misstyping it.

iandees commented 3 years ago

I could see us using something like libphonenumber.js to format the number properly as it goes to OSM as a note. That'd be a useful pull request to add.