如何是使 file 域文本内容不能编辑?

csqcsq 2003-09-12 11:16:04
<input type="file">
如何是使 file 域文本内容不能编辑?
...全文
33 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
sailflying 2003-10-31
  • 打赏
  • 举报
回复
用自己的button触发file控件,可以达到File控件不能编辑的效果

代码:
————————————————————————————————————


<title>车仔手扎:控制File控件不能编辑</title>
<input type="file" id="fileAttachment" name="fileAttachment" class="button" onkeypress="return false;" style="display:inline;VERTICAL-ALIGN: middle; WIDTH:0px; position:absolute;clip: rect(0 0 0 0)">
 <button name="btnAttachment" id="btnAttachment" onclick="return fileAttachment.click();" >选取文件</button>
  • 打赏
  • 举报
回复
<input type="file" name="file" onkeypress='return false;' onpaste="return false;" onkeydown="return false" ondrag="return false">
Struggling 2003-10-18
  • 打赏
  • 举报
回复
disabled是不行的,连浏览也不能用了,本身就是readonly的了。

佩服 net_lover(孟子E章)
孟子E章 2003-09-12
  • 打赏
  • 举报
回复
<input type="file" onkeydown="return false" onpaste="return false">
konnyw 2003-09-12
  • 打赏
  • 举报
回复
readonly
yzwxjun 2003-09-12
  • 打赏
  • 举报
回复
<input type="file" disabled>
fzel_net 2003-09-12
  • 打赏
  • 举报
回复
<input type="file"disabled size="20">

87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧