如何允许文本框仅接受字母表 [英] How Do I Allow A Textbox To Accept Only Alphabets

查看:88
本文介绍了如何允许文本框仅接受字母表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望TextBox只允许输入字母。如果输入了数字,则不应接受该数字,也不会在文本框中显示。请指导我如何操作。

我正在使用Microsoft Visual Web Developer 2010 Express。

I want a TextBox to allow only alphabets to be entered . If a number is entered it shouldn't be accepted and not displayed in the textbox. Please guide me on how to do it.
I am using Microsoft Visual Web Developer 2010 Express.

推荐答案

您可以使用javascript来限制仅输入字符,请参阅以下链接

如何验证文本框只接受字符 [ ^ ]

如何制作asp文本框的按键事件? [ ^ ]

作为替代方法,如果你的项目已经使用了ajax控件工具包,请尝试

Ajax Control Toolkit FilteredTextBox [ ^ ]
You can use javascript to limit inputs to characters only, refer below links
how to validate textbox to accept only characters[^]
How to make keypress event of asp textbox?[^]
as an alternative approach if your project already using ajax control toolkit, try
Ajax Control Toolkit FilteredTextBox[^]


请参阅此处:仅javascript中的字母验证 [ ^ ]



问候..
See here : only alphabet validation in javascript[^]

Regards..


这篇关于如何允许文本框仅接受字母表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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