需要为角色和角色设置Keypress验证ASP.NET中的数字 [英] Need to set Keypress validation for characters & numbers in ASP.NET
本文介绍了需要为角色和角色设置Keypress验证ASP.NET中的数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Everyone,
我是编程新手!
有人能告诉我是否可以在asp.net上做按键事件使用java脚本还是JQuery?或者执行此操作的步骤?
我有像移动设备这样的字段,其中我不想显示兆盒子,而我想使用按键事件阻止字符。
不知道在c#中怎么做才有可能?
问候,
Nikhil
Hello Everyone,
I am new to programming!
Can someone tell me if we can do keypress event in asp.net using java script or JQuery? or the steps to do this?
I have fields like mobile, amount where i don't want to display meg box rather i want to block characters using keypress event.
Don't know how to do it in c# is it possible?
Regards,
Nikhil
推荐答案
请查看我最近的答案,其中包括有和没有jQuery的技术:如何删除按键事件中输入的字符 [ ^ ]。
验证规则,不与我们分享,在您身上。我唯一的建议是:不要让它们太复杂,它可能会极大地混淆用户。例如,不要使规则位置或上下文敏感。只需过滤掉我们不想要的角色。
-SA
Please see my recent answer which covers this technique with and without jQuery: how to delete the character typed in key press event[^].
The validation rules, which is did not share with us, are on you. My only advice is: don't make them too complicated, it could greatly confuse the user. For example, don't make the rules position or context sensitive. Just filter our unwanted characters.
—SA
这篇关于需要为角色和角色设置Keypress验证ASP.NET中的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文