本文介绍了数字大于0的验证(正则表达式)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用正则表达式验证器...我想检查数字是否大于零..如果0表示它不会进入..这是我的验证器..检查并提出解决方案..

 <   asp:RegularExpressionValidator     ID   =  revAvailablePeriod    runat   = 服务器    ErrorMessage   = 必须大于0    ControlToValidate   =  txtQuantity     ValidationExpression   =  ^ [1-9] [0-9] * $    SetFocusOnError   =  true    ValidationGroup   =  AddAssests   >  





在这不能键入0它的oky ...但我必须键入0.2,0.25,0.12等。(因为它大于零正确!...)..



我想输入小于零的十进制数。请帮助..

解决方案




Hi,
I am using a regular expression validator ...I want to check if number is greater than zero ..if 0 means it will not enter ..here is my validator ..check it and suggest a solution..

<asp:RegularExpressionValidator ID="revAvailablePeriod" runat="server" ErrorMessage="Must be greater than 0" ControlToValidate="txtQuantity" ValidationExpression="^[1-9][0-9]*$" SetFocusOnError="true" ValidationGroup="AddAssests" >



in this can't type 0 its oky...but I have to type 0.2, 0.25 ,0.12 etc. .(since it greater than zero right!...)..

I want to type decimal also that grater than zero. So please help..

解决方案




这篇关于数字大于0的验证(正则表达式)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-21 14:14