Q:

number only html form

what is the code if you want that only number should be inputted in an html textbox.
If you input letters there will be no letter that would show. If you input numbers, the numbers would show, please help

A:

If you wish to risk using draft specs, you can use the number type:
<input name="foo" type="number">

(See also, the specification) 
Browser support for this is currently very limited, but increasing. You will probably want to add JavaScript to simulate support in less bleeding edge browsers. There are various projects to do this, including jsh5f and webforms2.
Obviously, no matter which approach you take to the problem, you will still need a server side check of the data (you can never trust the client since any restrictions you impose there can be bypassed by the user).

A:

Try this:  
 <HTML>
       <HEAD>
       <SCRIPT type="text/javascript">

          function isNumberKey(evt)
          {
             var charCode = (evt.which) ? evt.which : event.keyCode
             if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;

             return true;
          }

       </SCRIPT>
       </HEAD>
       <BODY>
          <INPUT id="txtChar" onkeypress="return isNumberKey(event)" type="text" name="txtChar">
       </BODY>
    </HTML>

