Gracias Carnal me sacaste de un apuro Chido tu aporte
![Aplauso](http://static.forosdelweb.com/fdwtheme/images/smilies/aplausos.gif)
Cita:
Iniciado por ceSharp
hola algadar,
he probado esa función que pones y no funciona muy bien que digamos... si quieres cópiate esta, que es la típica de expresiones regulares y tal...
--------------------------------------
function acceptNum(e)
{
var tecla;
tecla = (document.all) ? e.keyCode : e.which;
if(tecla == 8)
{return true;}
var patron;
//patron = /[abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUV WXYZ0123456789]/
patron = /\d/; //solo acepta numeros
var te;
te = String.fromCharCode(tecla);
return patron.test(te);
}
---------------------------------
para hacerla funcionar recuerda que usamos el evento onkeypress="return acceptNum(event)"
salu2