0
可能重複:
Which is the proper way of filtering numeric values for a text field?阻斷重音字符
我有一個文本字段,其中只有數字就可以了。 我用正則表達式/^[0-9] /,它阻止了大部分字符。 但不是選項+ E,選擇+ N等
使用的MacOSX 10.7.3
試戴的keydown & KEYUP文本字段的完全阻塞Alt鍵,但沒有運氣
function block(evt) {
if(evt.altKey==true)
return false;
return true;
}
請建議。
你應該看看這個[堆棧溢出答案](http://stackoverflow.com/questions/10866444/which-is-the-proper-way-of-filtering-numeric-值換一個文本字段)。 –