Ext实现方式:

Ext.getDoc().on('keydown',function(e){ 
    if(e.getKey() == 8 && e.getTarget().type =='text' && !e.getTarget().readOnly){ 
           
    }else if(e.getKey() == 8 && e.getTarget().type =='textarea' && !e.getTarget().readOnly){  
       
    }else if(e.getKey() == 8){ 
        e.preventDefault(); 
    
});

JS实现方式:

function document.onkeydown()  
{  
  if ((event.keyCode==8) ) //屏蔽退格删除键 
  {  
    if (window.event.srcElement.tagName.toUpperCase()!="INPUT" && window.event.srcElement.tagName.toUpperCase()!="TEXTAREA" && window.event.srcElement.tagName.toUpperCase()!="TEXT"
    
      event.keyCode=0;  
      event.returnValue=false
    }  
  }  

 

 

原文:http://www.cnblogs.com/kristain/articles/2106140.html

相关文章:

  • 2022-12-23
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
  • 2021-07-21
  • 2022-01-23
猜你喜欢
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2021-08-23
  • 2021-06-23
  • 2021-11-01
相关资源
相似解决方案