Ver Mensaje Individual
  #6 (permalink)  
Antiguo 08/02/2006, 13:50
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 3 meses
Puntos: 772
Hola mabarcau

Te completo el ejemplo de flaviovich
Código:
<html>
<head>
<script type="text/javascript">
function validarNum(e)
{
    tecla = (document.all) ? e.keyCode : e.which;
    if (tecla == 8) return true;
    patron = /\d/;
    te = String.fromCharCode(tecla);
    return patron.test(te);
}
</script>
</head>
<body>
<input type="text" onkeypress = "return validarNum(event)" />
</body>
</html>
Saludos,