Return to Snippet

Revision: 49657
at July 27, 2011 18:25 by punuhan


Initial Code
<HTML>
   <HEAD>
   <SCRIPT language=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>

Initial URL

                                

Initial Description

                                

Initial Title
accept only numeric data from keyboard in javascript

Initial Tags

                                

Initial Language
JavaScript