<tr><td>
用户登陆密码 :
</td><td> <html:password property="user_password"/></td></tr>
<tr><td>
重复用户登陆密码 :
</td><td> <input type="password" name="user_password2"/></td></tr>

解决方案 »

  1.   

    http://www.dnbcw.com/biancheng/javascript/icnk121846.html
      

  2.   

    楼上这位兄弟 我知道这个function click(e) 

    if (document.all) 

    if (event.button==1||event.button==2||event.button==3) 

    oncontextmenu='return false'; 


    if (document.layers) 

    if (e.which == 3) 

    oncontextmenu='return false'; 



    if (document.layers) 

    document.captureEvents(Event.MOUSEDOWN); 

    document.onmousedown=click; 
    document.oncontextmenu = new Function("return false;") 
    var trxdyel=true 
    var hotkey=17 /* hotkey即为热键的键值,是ASII码,这里99代表c键 */ 
    if (document.layers) 
    document.captureEvents(Event.KEYDOWN) 
    function gogo(e) 

    if (document.layers) 

    if (e.which==hotkey && trxdyel) 

    alert('操作错误.或许是您按错键了!'); 


    else if (document.all) 

    if (event.keyCode==hotkey&&trxdyel){ alert('操作错误.或许是您按错键了!'); }} 

    document.onkeydown=gogo 
    但他的效果是在这页面所有的东西全都屏蔽了 
    和我的需求就不一样了!
      

  3.   

    document.onkeydown=gogo  ==>
    getElementById("yourpwdID").onkeydown = gogo;
      

  4.   

    哥们 我按你的方法试了 但不起作用啊  还是所有控件的右键不能使了 但所有控件的粘贴都行了 
    function click(e)    {       if (document.all)       {          if (event.button==1||event.button==2||event.button==3)           {              oncontextmenu='return false';          }      }      if (document.layers)       {  
             if (e.which == 3)          {  
               oncontextmenu='return false';         }      }   }      if (document.layers)    {       document.captureEvents(Event.MOUSEDOWN);   }  document.onmousedown=click;   document.oncontextmenu = new Function("return false;")      
     var trxdyel=true  var hotkey=17   /* hotkey即为热键的键值,是ASII码,这里99代表c键 */  if (document.layers)       document.captureEvents(Event.KEYDOWN)   function gogo(e)   {       if (document.layers)        {           if (e.which==hotkey && trxdyel)          {              alert('操作错误.或许是您按错键了!');          }      }     else if (document.all)     {         if (event.keyCode==hotkey&&trxdyel){ alert('操作错误.或许是您按错键了!'); }}    }     getElementById("user_password2").onkeydown = gogo;
      

  5.   

    网上有,你找下,我也是快下班了,没时间给你写~~~因为你可能在项目中,所以我可能暂时帮不了你~其实原理就是input:text在click事件触发或者键盘事件发生时,做一个判断,看是否在做复制、粘贴动作,如果是,则return false来取消本次操作
      

  6.   

    很简单,如下:
    <input type="password" name="user_password2" onpaste="return false;" oncopy="return false;"/>
      

  7.   

    这个可以自己写,和前一个的text值进行比较就可以了