Home > Web Front-end > JS Tutorial > Input prohibits keyboard and Chinese input, but can be clicked_javascript skills

Input prohibits keyboard and Chinese input, but can be clicked_javascript skills

WBOY
Release: 2016-05-16 17:00:13
Original
1751 people have browsed it

I searched a lot online, but it’s not practical or has compatibility issues. This one works!
Keyboard and Chinese input are prohibited, but readonly cannot be used and it must be compatible with ie and ff. It took a lot of effort to complete this function, haha, record it here for future use; in addition, pasting onpaste is prohibited ="return false"

Copy code The code is as follows:




New Document ;
// Style style="ime-mode:disabled" disables Chinese input
function noPermitInput(e){
var evt = window.event || e ;
if(isIE()) {                  evt.returnValue=false; //                                                                                                    evt.returnValue=false;                                                                       isIE() {                                                                                                                



Disable keyboard key input and Chinese input




Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template