仅接受字符串数据类型中的文本 [英] Accept only text in string data type
本文介绍了仅接受字符串数据类型中的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在php中开发了一个应用程序。对于文本框,我给出了一个字符串数据类型,但它接受文本和数字。我该怎么办?我希望该文本框只接受文本而不是数字。
Plz帮帮我........
谢谢....
我尝试了什么:
我试过使用is_numeric($ a)函数但是我想要文本框不接受该号码。
I have developed one application in php. For the textbox I have given a string data type but it is accepting both text and numbers. what should I do? I want that textbox to accept only the text not the numbers.
Plz help me out........
Thanks....
What I have tried:
I have tried to use is_numeric($a) function but I want the textbox not to accept the number.
推荐答案
a)功能,但我希望文本框不接受该号码。
a) function but I want the textbox not to accept the number.
请看看我对这个问题的评论。
例如,参见这本快速手册:键盘文本输入过滤:示例。
另请参阅:
按下,
Event.preventDefault(),
Event.defaultPrevented ,
Event.cancelable ,
Event.stopPropagation()。
-SA
Please see my comment to the question.
See, for example, this quick manual: Keyboard Text Input Filtering: Examples.
See also:
keypress,
Event.preventDefault(),
Event.defaultPrevented,
Event.cancelable,
Event.stopPropagation().
—SA
谢谢你的解决方案........
但是我已经实现了我不允许键码(ASCII)值的解决方案在文本框中输入。
希望它对其他人有用....
Thank You for the solution ........
But i have implemented the solution in which I am not allowing the keycode(ASCII) values to be entered in the textbox.
Hope it will be useful for others....
这篇关于仅接受字符串数据类型中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文