限制字符输入(ASCII 码)
function onkeypressEvent()
{
//0-9
if(event.keyCode < 48 || event.keyCode>57)
{
//逗号,点号,减号,空格
if (event.keyCode != 44 && event.keyCode != 45 && event.keyCode != 46 && event.keyCode != 32)
{
//退格键
event.keyCode = 8;
}
}
}