文本框只接受11位数但不能全部为零 [英] Textbox to accept only 11 digits but not all zero

查看:100
本文介绍了文本框只接受11位数但不能全部为零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i使用这样的comparevalidator:



< asp:CompareValidator runat =serverid =cmpNumberscontroltovalidate =txtTIN

ValueToCompare =000000000operator =GreaterThantype =Integererrormessage =无效的锡号/>



但它在两种情况下显示错误信息我输入00000000000或12345678912为什么如此。

我正在检查敌人11位数。你建议只比较9位数000000000的价值。

请解释和帮助。

解决方案

前导零的数字( 0xxxxxxxx )不是整数值!



您需要比较字符串!这是一个想法: RegularExpressionValidator Control(General Reference) [ ^ ]

hi ,
i use comparevalidator like this:

<asp:CompareValidator runat="server" id="cmpNumbers" controltovalidate="txtTIN"
ValueToCompare="000000000" operator="GreaterThan" type="Integer" errormessage="Invalid Tin Number" />

but it shows error msg in both condition weather i enter 00000000000 or 12345678912 why so.
and i am checking foe 11 digit no. and you suggest value to compare only 9 digit 000000000.
pls explain, and help.

解决方案

Number with leading zero (0xxxxxxxx) is not integer value!

You need to compare string! Here is an idea: RegularExpressionValidator Control (General Reference)[^]


这篇关于文本框只接受11位数但不能全部为零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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