JavaScript输入控制
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>输入框控制</title>
<script>
function myKeyDown()
{
var k=window.event.keyCode;
if ((k==46)||(k==8)||(k==189)||(k==109)||(k==190)||(k==110)|| (k>=48 && k<=57)||(k>=96 && k<=105)||(k>=37 && k<=40))
{}
else if(k==13){
window.event.keyCode = 9;
}
else{
window.event.returnValue = false;
}
}
</script>
</head>
<body>
<input type=text style="ime-mode: disabled" onkeydown="myKeyDown();"/>
</body>
</html>
注:特殊字符!@#$%^&*()没有限制