如何使用自定义验证控件检查移动10位数的可用性 [英] How to Check availibility for mobile 10 digit number using Custom validation control

查看:84
本文介绍了如何使用自定义验证控件检查移动10位数的可用性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我想检查是否已退出10位数的手机号码使用自定义验证控件可以指导或发送任何片段

解决方案

检查数字是否存在不是验证号码的有效方法。例如,我以前的号码存在,但它不在服务中。即便如此,我也不相信有一种核心方法可以验证它是否存在。但是,如果您希望确保放入包装盒中的号码是客户的号码,有几种方法可以做到这一点。



第一种方式将使用服务来验证您的号码。这是该类服务的一个例子(不是推荐,只是一个例子):



http://www.onverify.com/ [ ^ ]



另一种更便宜的方法就是亲自进行验证。如果您只是验证手机,则可以使用生成的号码(只是一个短的随机字符串)向手机发送文本。让用户在表单中键入该字符串以验证他们是获得该消息的人。要实际发送短信,您可以便宜并通过电子邮件发送电话的短信电子邮件地址(每个运营商不同),或者您可以使用 Twilio [ ^ ]发送消息(每个文本在美国境内一美分)。我推荐Twilio。我过去曾经使用它们,无论是服务还是客户支持,它们都非常出色。




你可以使用下面的表达式使用regualr表达式验证器验证电话号码



引用:

var phoneFormat = / ^ \ +?\d {1,3}( - |)?\d {3,5}( - |)?\d {1,10}

/;





谢谢

www.alacraft.com.au


Hello
I want to check either 10 digit mobile number is exited or not using Custom validation control can u guide or send any snippets

解决方案

Checking whether a number exists or not would not be a valid way of verifying the number. For instance, my former number exists but it is not in service. Even so, I do not believe there is one central way to verify that it "exists". However, if you are looking to be sure that the number put into the box is the customers' number, there are a couple ways of doing this.

The first way would be to use a service to verify the number for you. This is one example of that type of service (not a recommendation, just an example):

http://www.onverify.com/[^]

Another way that would be cheaper would be to do the verification yourself. If you are only verifying mobile phones, you could send a text to the phone with a generated number (just a short random string). Have the user type that string into your form to verify they were the ones that got the message. To do the actual sending of the text message, you could go cheap and email the text message email address of the phone (different for each carrier) or you could use a service such as Twilio[^] to send the message (at one cent per text inside the US). I do recommend Twilio. I've used them in the past and they are excellent, both in terms of their service as well as their customer support.


Hi,
You can use the below expression using regualr expression validator to validate the phone number

Quote:

var phoneFormat = /^\+?\d{1,3}(-|)?\d{3,5}(-|)?\d{1,10}


/;



Thanks
www.alacraft.com.au


这篇关于如何使用自定义验证控件检查移动10位数的可用性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆