How JavaScript prevents the keypad from entering numbers:
Do not know why to prohibit the keypad input numbers, but there is a need, but it is also very simple, is simply through the key code to determine whether the keypad is pressed, the following directly see the code, code examples are as follows:
functionIsnum ()//determine the keypad input number{ varStr=(Window.event.keyCode); if(str>105 | | str<96 ) { if(str!=8) {Window.event.returnValue=false; return; } } } functionIsnumup ()//determine the main keyboard input number{ varStr=(Window.event.keyCode); if(str>57 | | str<48 ) { if(str!=8) {Window.event.returnValue=false; return; } } }
The above code can determine whether to use the keypad input numbers, here is not more introduced, it is easy to see.
You can refer to the JS keyboard key KeyCode property value corresponding to the table section.
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=9260
For more information, refer to: http://www.softwhy.com/javascript/
How JavaScript disables keypad input numbers