How do I filtered TextBox with a Decimal (double) Data Type
来源:互联网 发布:剑三喵哥捏脸数据大全 编辑:程序博客网 时间:2024/06/13 04:55
一直以来,在开发过程中,都是验证用户输入的是否为整数。这次系统却需要验证用户输入Decimal或是Double数据类型的值。以前做验证,用的是RegularExpressionValidator来验证。
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtQuantity"
Display="None" ErrorMessage="栏位,非有效数值!" ValidationExpression="^/d*/.?/d*$"></asp:RegularExpressionValidator>
这次由于验证的栏位较多,想在输入时即刻filter。现使用下面的方法:
<asp:TextBox ID="txtQuantity" runat="server" onkeyup="value=value.replace(/[^-?/d/.]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^-?/d/.]/g,''))" ></asp:TextBox>
- How do I filtered TextBox with a Decimal (double) Data Type
- How do I rename a data file
- How do I rename a data file
- How do I create a time-series object with dates?
- How do I install a file in my local repository along with a generic POM?
- How do I read in a character variable with varying length in a space delimited dataset?
- How do I read in a character variable with varying length in a space delimited dataset?
- how do i rotate a matrix transformation with a centered origin
- How Do I get Started with Oracle?
- How do I get started with CUDA?
- How do I pass data between Activities/Services within a single application?
- zz - reprint of "How do I implement a data bound dialog box?"
- How do I read image data from a URL in Python ?
- DECIMAL Data Type Characteristics
- DB2 DECIMAL data type
- How do I generate compatible train and test sets that get processed with a filter?
- How do I determine if a web page exists with shell scripting?
- How do I reset a jquery-chosen select option with jQuery?重置chosen组件值状态
- 认识Selenium -- Test Runner 模式和使用
- 高考作弊乱到抢卷发人深省ks
- 绿霸试用手记
- 利用Javascript脚本捕获键盘事件
- sql系统函数
- How do I filtered TextBox with a Decimal (double) Data Type
- 网站工程管理与规范 (转)
- VC使用双缓存技术,解决闪屏问题
- ASP.NET程序中常用的三十三种代码
- Windows Mobile 5.0 配置之网络连接
- 将PCM数据转换成WAV文件
- 软件质量管理的八个法则
- SaaS的个性化问题值得关注
- java io InputStream Reader