限制用户只能输入1)数字,2)10位数字,3)不允许使用字母数字4)所有10位数字相同不允许在TextBox中没有javascript [英] Restrict user to enter only 1) numbers, 2) 10 digits, 3) alphanumeric not allow 4) all 10 digit is same not allow in TextBox Without javascript

查看:96
本文介绍了限制用户只能输入1)数字,2)10位数字,3)不允许使用字母数字4)所有10位数字相同不允许在TextBox中没有javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)如何限制用户只输入文本框中的数字而不使用javascript。

2)如何限制用户只在文本框中输入10位数(手机号码)不使用javascript。 3)或者如何限制用户只在文本框中输入不允许的字母数字。

4)如何限制10位数同样不在texbox中输入exp :-( 1111111111)。

并且只输入这个数字(forexp:-8791167545)(forexp:-7417150939)(forexp:-8869077090)

1) How to restrict user to enter only numbers in textbox Without using javascript.
2) How to restrict user to enter only 10 digits(mobile number) in textbox Without using javascript.
3) Or how to restrict user to enter only alphanumeric in not allow in textbox.
4) How to restrict 10 digit same not enter exp:-(1111111111) in texbox.
and only enter this digit(forexp:-8791167545)(forexp:-7417150939)(forexp:-8869077090)

推荐答案

使用< a href =http://www.w3schools.com/aspnet/control_regularexpvalidator.asp> RegularExpressionValidator Control [ ^ ]



对于RegularExpressions,请检查这些

Expresso - 用于构建和测试正则表达式的工具 [< a href = http://www.codeproject.com/Articles/3669/Expresso-A-Tool-for-Building-and-Testing-Regular-Etarget =_ blanktitle =New Window> ^ ]

30分钟正则表达式教程 [ ^ ]
Use RegularExpressionValidator Control[^]

For RegularExpressions, check these
Expresso - A Tool for Building and Testing Regular Expressions[^]
The 30 Minute Regex Tutorial[^]


这篇关于限制用户只能输入1)数字,2)10位数字,3)不允许使用字母数字4)所有10位数字相同不允许在TextBox中没有javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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