Código HTML:
<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> <font face="tahoma" size=4> <center>Numeric TextBox </center></font> <form> Enter the Number :<br/> <input type="text" onKeyPress="return keyCheck(event, this)"><BR/> <input type="text1" onKeyPress="return keyCheck(event, this)"> <label> <input type="button" a name="Submit2" value="Enviar" /> </label> </form>