实现对input type='file'的text输入框设置只读属性

  • 设置readOnly=true
  • 设置disable
  • 设置this.blur()
  • 通过javascript来控制
  • 。。。

都不行,因为只要是readOnly或disable,都无法弹出选择文件的窗口,即使用javascript实现了弹出,上传时也不行(ASP.net中),最后还是把中心放在了让他没有焦点上,设置了hideFocus=true也不行,于是开始详细的翻阅MSDN,input type=file的所有属性,终于还是让我找到了

<INPUT class="text" id="fileUpload" style="WIDTH: 500px;cursor:hand" type="file" name="fileUpload" 
UNSELECTABLE
="on">
posted on 2008-09-30 14:26  Dot-Boy  阅读(3348)  评论(1编辑  收藏  举报