允许在文本框中使用数字 [英] Allow numeric in textbox

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

问题描述

您好,



我正在开发一个Web应用程序..我想在文本框中允许数字..

这是代码我在aspx中使用for validtaion但无法得到结果..

可以帮助我解决这个问题...



谢谢



Hello,

Im develpoing a web application.. i want to allow numbers in textbox ..
This is the code which im using in aspx for validtaion but couldn't get the result ..
can any one help me to solve this...

Thank you

<asp:RegularExpressionValidator ID ="RegularExpressionValidator_CardCode" runat="server" ControlToValidate="RadTb_CardCode" ErrorMessage="CardCode Invalid(Numbers Only)" Display="Dynamic" ValidationExpression="^\d*"></asp:RegularExpressionValidator>

推荐答案

您好,

更改ValidationExpression从

Hello ,
Change the ValidationExpression from
ValidationExpression="^\d*"



to


to

ValidationExpression="^\d+

< br>


我有一个卡片详细信息的文本框,它不仅可以验证输入的每个数字卡,还可以识别提供者。我使用jQuery来做这件事并阻止NaN被输入



I have a textbox for card details which not only validates the card on each digit entered but also identifies the provider. I used jQuery to do this and prevent NaN's from being entered


这篇关于允许在文本框中使用数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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