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("Not possible here Enter Chinese/full-width characters"); } } }
But few people use ime-mode:disabled (implemented with css Close the text box input method) ime-mode Syntax: ime-mode: auto | active | inactive | disabled Value: auto: Default value. Does not affect the status of IME. The same as when the ime-mode attribute is not specified active: specifies all characters entered using IME. That is to activate the local language input method. The user can still deactivate the IME inactive : Specifies all characters that are not entered using the IME. That is to activate non-native languages. The user can still deactivate the IME disabled : Disable the IME completely. For focused controls (such as input boxes), the user cannot activate the IME
Then:
ime-mode:disabled is to disable the input method. Extension:
Think about it yourself~ 2. .Restrict the text box from pasting: Generally when we see this, we will have this idea: disable the Ctrl key and C key, and then disable the right click, you can perfectly disable the paste function. Then you need to write a JS file (this JS file has relevant content on this blog) In fact, onpaste="return false;" can perfectly disable pasting, and be aware that it disables pasting. function, so using this attribute, the user cannot paste content even if the right click is not disabled.
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn