Summary of some restrictions on text boxes ~~ _ Form special effects

Source: Internet
Author: User
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:


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.