First, send a method. The function is to return the Boolean Type by controlling the keycode of the keyboard.
<SCRIPT type = "text/JavaScript">
Function checkints (EVT)
{
If (EVT. keycode >=96 & EVT. keycode <= 105) |
(EVT. keycode >=48 & EVT. keycode <= 57) |
EVT. keycode = 8 | EVT. keycode = 37 |
EVT. keycode = 38 | EVT. keycode = 39 |
EVT. keycode = 40 | EVT. keycode = 13 | EVT. keycode = 46)
{
Return true;
}
Else
{
Return false;
}
}
</SCRIPT>
In the edit box, you can use onkeydown = "Return checkints (event)" to control whether the corresponding characters can be entered. In this case, no other illegal characters can be entered in the edit box, results During the test, the Microsoft input method is harmful. Observe the differences between the Microsoft input method and other input methods in character input, and cancel the input control method, perform regular expression verification on the control.
However, I thought about it carefully later. If it was based on the original design, it would not work for the customer to get there.
Write this article so that you can come up with a better method. If you don't have it, don't waste your time. Don't be as clever as me and think that you don't have to perform verification if you control the input.