In fact, old cadres will also make mistakes, today's friends in the bank card account when asked to enter the number, it is actually excluding Chinese. In fact, the regular is very important. Say less nonsense. What if I forbid Chinese?
But this method of compatibility is not very good, first we need to know.
The Ime-mode of CSS
Grammar:
Ime-mode:auto | active | Inactive | Disabled
Value:
Auto: Default value. Does not affect the state of the IME. Same as do not specify Ime-mode property
Active: Specifies all characters that are entered using the IME. The local language input method is activated. Users can still revoke the activation IME
Inactive: Specifies all characters that do not use IME input. The non-native language is activated. Users can still revoke the activation IME
Disabled: Disables the IME entirely. The user cannot activate the IME for a control that has focus (such as an input box)
Description: Sets or retrieves whether the user is allowed to activate Input Method (IME) status in Chinese, Korean, Japanese, and so on. This property is read-only for Currentstyle objects. Readable and writable for other objects. The corresponding script attribute is IMEMode.
That's it. So when a text field does not require Chinese input, we can reduce the likelihood of errors by setting the Ime-mode property value to inactive or disabled. Similarly, we can set the Ime-mode property value of the text field that requires Chinese input to active.
Usually the business system of C/s, will pay attention to input method control problems. Development based on B/S business system, will also encounter the same problem, Ime-mode believe can help. However, FireFox does not support this style sheet property.
Direct text Verification, many people like to listen to the keyboard, judge the keyboard code, test, a bit of a problem, such as Sogou Chinese input, if you hit a long list of Chinese, finally select the number, determine which string. Listening events cannot be monitored. Our best way is to listen to text, text listening to the end of the listening keyboard when the event onkeyup, the text must also be full text scanning '/g ', which is a lot of the initial use of the regular said easy to forget. Here's the simplest way to do it.
<type= "text" style= "ime-mode:disabled" onkeyup = "This.value=this.value.replace (/[^\d]/g, ')"/>
Input=text Digital Issues