如何限制用户输入单词中的电话号码? [英] How to restrict User to enter Phone number in words ?

查看:99
本文介绍了如何限制用户输入单词中的电话号码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在使用Asp.net设计wepage并使用Sql server作为数据库

我使用了Multiline文本框,用户必须在其中输入他们的详细信息。

喜欢数字兄弟姐妹家庭状况,家庭收入来源。

但是用户无需输入他/她的电话/联系电话。

为此,我限制了用户通过asp.net输入任何nuberic数字

正则表达式。但是用户太聪明了,现在他们用语言输入他/她的联系电话

假设某人的联系电话是533445928,因为他们无法输入数字

因为asp.net正则表达式,允许用户只输入字母表。现在他们正在输入他们的联系电话,如五三三四有九二八七。我想限制用户输入单词中的联系人详细信息。

Hi I am designing wepage using Asp.net with Sql server as database
I have used Multiline textbox in which user has to enter their family detail.
Like number of brother and sister family status, source of Earning for family.
But User do not have to enter his/her phone/contact number.
For that I restricted the user to enter any nuberic digit through asp.net
Regex. But User is too smart now they are entering his/her contact number in words
Suppose somebody's Contact number is 533445928 as they can not enter numberic digit
because of asp.net regex which allows the user to enter only alphabets. Now they are entering their contact number in words like five three three four four nine two eight seven. I would like to restrict the user to enter contact detail in words also.

推荐答案

您可以询问具体问题,然后您可以验证输入。例如,如果你需要知道兄弟姐妹的细节,那么问你有兄弟姐妹吗?答案是肯定还是否定。基于此你可以问下一个问题。有多少姐妹?有多少兄弟等..这些问题只是例如,你可能需要为答案提出一套好的问题和验证。否则当你找到限制一种方式的方式时,用户会找到其他数百种方式。
you can ask specific question and then you can validate the input. for example if you need to know the details of brothers and sisters then ask "do you have brothers or sisters?" answer will be yes or no. based on that you can ask next question. how many sisters? how many brothers etc.. these questions are just for example, you may need to come up with good set of question and validations for the answers. otherwise when you find way to limit one way users will find hundred other ways.


这篇关于如何限制用户输入单词中的电话号码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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