lo llamo así.
onKeyPress="return numeros(event)"
Código Javascript:
Ver original
<script language="JavaScript"> <!-- var nav4 = window.Event ? true : false; function numeros(evt){ // NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57 var key = nav4 ? evt.which : evt.keyCode; return (key <= 32 || (key >= 48 && key <= 59)); } //--> </script>