Design comparison
Solution retrospective
I spent a lot of time working on the phone number validation. In the end, I used an npm package called "awesome-phonenumber" that incorporates Google's phone number validation. I coupled that with http://ip-api.com to get the country code of the IP address accessing the site to format the phone number correctly. However, since I use Firebase for hosting the website, they enforce HTTPS and you are only allowed to access the HTTP endpoint on the IP API website on the free version which now causes the country code lookup to fail since browsers block mixed content. It was a good learning experience but unfortunately the number validation will only work for US numbers. Overall this was a very time consuming project for me since I don't have a lot of experience with forms and their validation.
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord