<input type="file" id="FileUpload1" readonly/>
直接这么写让它只读好了,你那样写还是可以粘贴、拖拽的。

解决方案 »

  1.   

    <input type="file" id="FileUpload1" readonly/>
    直接这么写让它只读好了,你那样写还是可以粘贴、拖拽的。你试一下我这么做
    我试过不能复制粘贴
    至于拖拽
    我现在去试
      

  2.   

    fileupload.setAttribute("onmousedown","return false;");
    fileupload.setAttribute("onkeydown","return false;");upfileupload.onmousedown = function () { return false; };
    fileupload.onkeydown= function () { return false; };
      

  3.   

    行了谢谢
    为什么我不能用
    setAttribute 来添加事件呢
      

  4.   

    那个onmousedown 和 onkeydown 方法,必须触发一个函数,
    所以必须要那样滴。而不是给定 具体值。。
      

  5.   

    我觉得这个setAttribute 有时候只能用作添加自定义属性
    但又不是完全只作用于这一点上
    fileupload.setAttribute("type","file");要不这一句也没用拉
      

  6.   

    fileupload.setAttribute("onmousedown","return false;");
    fileupload.setAttribute("onkeydown","return false;");在IE下是无效的……
    在FF下好像有用……
      

  7.   

    我只用这个设置className or class属性。。
    因为直接.class会出错。。所以要用这个设置^o^
      

  8.   

    fileupload.attachEvent("onmousedown","return false");