文字框文字限制 [英] Textbox text restriction

查看:58
本文介绍了文字框文字限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本框.在文本框中,如果我在小数点后输入3个以上的数字,则应抛出一个味精...在小数点后,它应仅接受零(0)作为第一个数字...并且我想比较3个数字中的最后两个数字如果输入的最后两位数字超出该值,则应抛出一个味精.我该怎么办...您能帮我吗...

Hi, I have a textbox. In textbox if i enter more than 3 digits after the decimal it should throw a msg...After the decimal it should accept only Zero(0) as 1st digit...And i wanna compare last two digits out of 3 digits after the decimal with a value.. If the entered last two digits exceeds the value then it should throw a msg..How can i do it...Can u help me...

推荐答案

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"

    ControlToValidate="TextBox1" ErrorMessage="RegularExpressionValidator"

    ValidationExpression="(^\d*\.\d{3}


)" < /asp:RegularExpressionValidator >


这篇关于文字框文字限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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