text: ﻿function AllowOnlyNumbers(e) {
  
      e = (e) ? e : window.event;
      var key = null;
      var charsKeys = [
          97, // a  Ctrl + a Select All
          65, // A Ctrl + A Select All
          99, // c Ctrl + c Copy
          67, // C Ctrl + C Copy
          118, // v Ctrl + v paste
          86, // V Ctrl + V paste
          115, // s Ctrl + s save
          83, // S Ctrl + S save
          112, // p Ctrl + p print
          80 // P Ctrl + P print
      ];
  
      var specialKeys = [
      8, // backspace
      9, // tab
      27, // escape
      13, // enter
      35, // Home & shiftKey +  #
      36, // End & shiftKey + $
      37, // left arrow &  shiftKey + %
      39, //right arrow & '
      46, // delete & .
      45 //Ins &  -
      ];
  
      key = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;
  
      //console.log("e.charCode: " + e.charCode + ", " + "e.which: " + e.which + ", " + "e.keyCode: " + e.keyCode);
      //console.log(String.fromCharCode(key));
  
      // check if pressed key is not number 
      if (key && key < 48 || key > 57) {
  
          //Allow: Ctrl + char for action save, print, copy, ...etc
          if ((e.ctrlKey && charsKeys.indexOf(key) != -1) ||
              //Fix Issue: f1 : f12 Or Ctrl + f1 : f12, in Firefox browser
              (navigator.userAgent.indexOf("Firefox") != -1 && ((e.ctrlKey && e.keyCode && e.keyCode > 0 && key >= 112 && key <= 123) || (e.keyCode && e.keyCode > 0 && key && key >= 112 && key <= 123)))) {
              return true
          }
              // Allow: Special Keys
          else if (specialKeys.indexOf(key) != -1) {
              //Fix Issue: right arrow & Delete & ins in FireFox
              if ((key == 39 || key == 45 || key == 46)) {
                  return (navigator.userAgent.indexOf("Firefox") != -1 && e.keyCode != undefined && e.keyCode > 0);
              }
                  //DisAllow : "#" & "$" & "%"
              else if (e.shiftKey && (key == 35 || key == 36 || key == 37)) {
                  return false;
              }
              else {
                  return true;
              }
          }
          else {
              return false;
          }
      }
      else {
          return true;
      }
  }