Summary of some restrictions on text boxes ~~
1. Chinese characters cannot be entered in the restricted text box:
In the past, we often used judgment to write data, for example:
The Code is as follows:
Function nocn (obj)
{
For (I = 0; I {
Var c = document. getElementsByName ("Text1") [0]. value. substr (I, 1 );
Var ts = escape (c );
If (ts. substring (0, 2) = "% u ")
{
Document. getElementsByName ("Text1") [0]. value = "";
Alert ("Chinese/fullwidth characters cannot be entered here ");
}
}
}
But few people use ime-mode: disabled (use css to disable text box input methods)
Ime-mode
Syntax:
Ime-mode: auto | active | inactive | disabled
Valid value:
Auto: default value. The IME status is not affected. Same as when the ime-mode attribute is not specified
Active: Specify all characters entered using IME. Activate the local language input method. You can still cancel IME activation.
Inactive: specifies all characters that do not use IME. Activate a non-local language. You can still cancel IME activation.
Disabled: Completely disable IME. For controls with focus (such as input boxes), you cannot activate IME.
So:
Ime-mode: disabled indicates the disabled input method.
Extension:
The Code is as follows: