andrew4582

CheckForInt

Feb 26th, 2012
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function CheckForInt(e) {
  2.     var charCode
  3.     if (window.event) // IE
  4.     {
  5.         charCode = event.keyCode; //e.keyCode;
  6.     }
  7.     else if (e.which) // Netscape/Firefox/Opera
  8.     {
  9.         charCode = e.which;
  10.     }
  11.     //var charCode = ( event.which ) ? event.which : event.keyCode;
  12.     return (charCode >= 48 && charCode <= 57);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment