0
我已經想出了以下代碼來限制貨幣輸入。用戶可以使用home,end和arrow鍵,但是ctrl + a被阻止,因爲FireFox不能識別組合鍵。這在Chrome和IE中正常工作。Firefox - 允許在文本字段中選擇全部,但只允許數字和句點
有沒有辦法讓FireFox中的字段全部選中,或者這是FireFox中的錯誤? (或者在其他瀏覽器中的錯誤是我「剝削」?)
function autoFormatNumeric(field, e) {
var charCode = e.which ? e.which : field.keyCode;
if ((charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))) {
e.preventDefault();
}
}