javascript 输入重复密码 不允许复制粘贴 <tr><td>用户登陆密码 :</td><td> <html:password property="user_password"/></td></tr><tr><td> 重复用户登陆密码 :</td><td> <input type="password" name="user_password2"/></td></tr> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.dnbcw.com/biancheng/javascript/icnk121846.html 楼上这位兄弟 我知道这个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 但他的效果是在这页面所有的东西全都屏蔽了 和我的需求就不一样了! document.onkeydown=gogo ==>getElementById("yourpwdID").onkeydown = gogo; 哥们 我按你的方法试了 但不起作用啊 还是所有控件的右键不能使了 但所有控件的粘贴都行了 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; 网上有,你找下,我也是快下班了,没时间给你写~~~因为你可能在项目中,所以我可能暂时帮不了你~其实原理就是input:text在click事件触发或者键盘事件发生时,做一个判断,看是否在做复制、粘贴动作,如果是,则return false来取消本次操作 很简单,如下:<input type="password" name="user_password2" onpaste="return false;" oncopy="return false;"/> 这个可以自己写,和前一个的text值进行比较就可以了 jquery grid组件的问题 JS字符串判断的一个问题! 正则表达式 请问各位大虾,WebQQ里面图标拖拉效果是用什么实现的啊?哪位大哥有源码我看看啊?急~~ 关于页面加载时图片压缩的问题. 请帮我看看,为什么老提示缺少对象?很急 动态表格的删除问题 哪个软件可以把普通的英文字符或汉字转换为UNICODE编码?? 怎样屏蔽掉打印预览的页面的“X”按钮? 老问题,怎么样打开一个页面后,强制打开文件下载对话框,请指教!!! select名称使用参数定义的问题请假,急急急!!! extjs datefield 显示问题
{
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
但他的效果是在这页面所有的东西全都屏蔽了
和我的需求就不一样了!
getElementById("yourpwdID").onkeydown = gogo;
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;
<input type="password" name="user_password2" onpaste="return false;" oncopy="return false;"/>