Validating mobile number
Apart from validation, you can check is it possible that it’s mobile.
It’s crucial to have correct number in database for such occasion.I don’t know about you, but i get lots of e-mail everyday. Some of them are short reminders that reside in my inbox for days to actually remind me of something.If I could choose, I would prefer to receive reminding SMS.There’s no spaces or other delimiters, and it’s best for storing in database. :\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(? So if you’ll try sending text message to invalid number – you’ll get response about invalid number and you won’t be charged for it. But still – if your user inputs some nonsense, he must wait for API response to see if it’s valid.It can be easily formatted when viewing (I’ll show you later how) so it would be probably your best storage choice. It should be better to prevalidate number before trying to send anything.Please note, that it can have also different separators than dashes and it would differ all over the world. So, before sending SMS you can call such API to check if number’s correct.
E164 format is simplest standard for managing numbers. Easy like calling API with number and receiving true/false as a result. Some Software-as-a-Service SMS providers would have such validation built-in.
Also it should not allow to enter any space, special charcter, as well as charcters. You can find an example in here S...-Java Script/6/ Hope this helps Mujahid Khaleel Web designing, development, E-commerce applications. Still iam unable to achive for writing the code for Phone No Validation.
Here user can enter either phone number or mobile number. Here user can enter either 10 digit number(which starts from 9) OR can enter 8 digit number(starts with 2).
Google is managing it, and for me it’s assurance that data will be consistent and all errors will be caught as soon as possible. Validation is pretty trivial: As you can see, library easily can parse any number.
In process, you’ll get object containing all knowledge about it.
Let’s consider fake US number: You can see that each format slightly differs from the others. How to check if number is valid, so we can send authorization code?