Intanto cerchiamo di dare un po' di ordine al codice…
codice:
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Esempio</title>
<script type="text/javascript">
function normalOnly(oToCheckField, oKeyEvent, sMode) {
var nChar = (oKeyEvent || /* IE */ window.event || { charCode: 0 }).charCode, rFilter;
switch (sMode) {
case "normal": rFilter = /[a-z0-9\s]/i; break;
case "number": rFilter = /\d/; break;
default: return true; // questa riga puoi anche eliminarla se proprio non ti serve
}
// alert("Il codice del carattere \u00E8: " + nChar + ". Il carattere digitato \u00E8: \"" + String.fromCharCode(nChar) + "\".");
return nChar === 0 || rFilter.test(String.fromCharCode(nChar));
}
</script>
</head>
<body>
<form name="myForm">
<input type="text" id="textgentel" onpaste="return false;" onkeypress="return normalOnly(this,event,'number');" value=""></p>
</form>
</body>
</html>
Provalo con Opera togliendo il commento a quell'alert (in rosso) e dicci che cosa ottieni.