So I am designing a webpage which will be used for global users, includes users from Canada, US, India, UK etc. I need to apply validations for this phone number field, but I'm not sure the best way to go about this.Some of the valid formats I can think of are:1800123456 (India)use of - in US phone numbersI am a bit confused about what special characters I should allow a user to enter (eg.- / ()). How have others solved this in the past?
What Special characters should one allow for a Phone Number?
javascript;validation;internationalization
Just because you can constrain something (that's what you're paid for, as a programmer, to write code), that doesn't mean you should actually do this.What's the point of validating a number?  Why is it useful?  Will it fail if a user enters 0800DIALTHIS, or , or (499) 123-45-67  4425?  It surely will (you say global. don't you?), while users just wanted to convey you an important piece of information on how to contact them via phone.Besides, they way data are stored should be governed by the way they're used.  How will you use the numbers?  Will they be used to auto-send SMS spamor they'll be manually dialed by managers?  If it's the latter, then allowing any additional characters is okay, since human brain will be able to parse them the way they see the most appropriate; and in this case you don't really need any validations, which will just annoy human users.