Hola Berletzis, aquí tienes otra de forma de hacerlo que he encontrado.
<HTML>
<head>
<script language="Javascript">
function keyCheck(eventObj, obj)
{
var keyCode
// Check For Browser Type
if (document.all){
keyCode=eventObj.keyCode
}
else{
keyCode=eventObj.which
}
var str=obj.value
if(keyCode==46){
if (str.indexOf(".")>0){
return false
}
}
if((keyCode<48 || keyCode >58) && (keyCode != 46)){ // Allow only integers and decimal points
return false
}
return true
}
</script>
<head>
<body>
<font face="tahoma" size=4> <center>Numeric TextBox </center></font>
<font face="tahoma" size=2>
<form>
<center> Enter the Number : <input type="text" onKeyPress="return keyCheck(event, this)"> </center>
</form>
</font>
</body>
</HTML>
Saludos