con deteccion de la tecla:
Cita: <html>
<head>
</head>
<script>
function LP_data(e){
key=(document.all) ? e.keyCode : e.which;
if (key < 48 || key > 57){
alert("solo se pueden ingresar numeros");
return false;
}
return true;
}//fin funcion
</script>
<body>
<form>
<input type="text" onkeypress="return LP_data(event)"></form>
</body>
</html>
o bien con expreciones regulares:
Cita: <html>
<head>
</head>
<script>
function LP_data(v){
patron=/[^0-9\.]/;
v.value=v.value.replace(patron,"");
}
</script>
<body>
<form>
<input type="text" onkeyup="return LP_data(this)"></form>
</body>
</html>
saludos