Ver Mensaje Individual
  #6 (permalink)  
Antiguo 28/10/2005, 03:38
Avatar de flaviovich
flaviovich
 
Fecha de Ingreso: agosto-2005
Ubicación: Lima, Peru
Mensajes: 2.951
Antigüedad: 18 años, 9 meses
Puntos: 39
hola JavierB y JuanKa!
Estу codigo hace lo que pides. Chequealo, y nos dices.
Código HTML:
<html>
<head>
<title>Untitled Document</title>
<script>
function validarNum(e)
{
    tecla = (document.all) ? e.keyCode : e.which;
    if (tecla == 8) return true;
    patron = /[0-9\,\.]/;
    te = String.fromCharCode(tecla);
    return patron.test(te);
}
</script>
</head>

<body>
<input name="txt_importe" type="text" id="txt_importe" size="10" onKeypress="return validarNum(event)" >
</body>
</html> 
__________________
No repitamos temas, usemos el Motor de busquedas
Plantea bien tu problema: Ayúdanos a ayudarte.