我找到了一个来源,前面是6位数,后面是两位数,但我不知道如何更改 我尝试了什么: < asp:TextBox ID =txtraterunat =serveronkeypress =if(event.keyCode< 48 || event.keyCode> 57 )event.returnValue = FALSE; MaxLength =9> < asp:RegularExpressionValidator runat =serverID =RegularExpressionValidator1 ValidationExpression =^ ((\d {5})* |([1-9] \d {0,5}))(\。\\\ {0,2})?$ ControlToValidate =txtrateText =输入必须为123456.78格式。 显示=动态/>
解决方案ControlToValidate =txtrateText =输入必须是123456.78格式。 显示=动态/>
开发不是一个在互联网上找到并粘贴它的过程进入你的应用程序:你应该考虑它并弄清楚它是如何工作的(或者更好地自己编写)。 在这种情况下,你不需要任何复杂的东西: ^ \\\\\\
会这样做。
I found a source where it is 6 digits before and two after but i do not know how to change What I have tried: <asp:TextBox ID="txtrate" runat="server" onkeypress="if(event.keyCode<48 || event.keyCode>57)event.returnValue=false;" MaxLength="9"> <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator1" ValidationExpression="^((\d{5})*|([1-9]\d{0,5}))(\.\d{0,2})?$" ControlToValidate="txtrate" Text="Input must be 123456.78 format." Display="Dynamic" />
解决方案 " ControlToValidate="txtrate" Text="Input must be 123456.78 format." Display="Dynamic" />Development isn't a process where you find something on the internet and paste it into your app: you are supposed to think about it and work out how it works (or better write it yourself). In this case, you don't need anything that complex: ^\d\.\d\dWill do it.
更多推荐
如何验证文本框小数点前1位和小数点后2位?
发布评论