我在验证中遇到问题。它可以在 google chrome 中运行,但不能在 Mozilla 中运行。
喜欢:我有一个表格,其中 Name: _ __ _ 。
我想进行验证,以便用户无法写入数值。
在javascript内部:
function checkerFunction1(e)
{
var charCode1=e.which || e.keyCode;
if((charCode1 >= 65 && charCode1 <= 90) ||(charCode1 >= 97 && charCode1 <= 122) ||(charCode1==32 || charCode1==8 || charCode1==46))
return true;
return false;
}
jsp页面内部:
<input type="text" value="Name" onkeypress="return checkerFunction1(window.event)"/>
为什么它在 Mozilla 中不起作用?