如何制作<输入类型="文件" />编辑? [英] How to make <input type="file" /> editable?

查看:110
本文介绍了如何制作<输入类型="文件" />编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了一些解释如何使input type = file不可编辑的例子。
like < input type =fileonkeydown =blur()/>



但是我在Visual Studio中做了测试应用程序,发现在默认情况下不可编辑的< input type =file/> 。 b

如何使它可编辑?

谢谢

解决方案 div>

< input type =file> 元素的行为受到浏览器的严格控制,您不能强迫他们做任何事他们想要做的。通常,现代浏览器将只允许使用文件选择器来选择要上传的文件。您的Javascript代码无法设置值,只能看到尾部文件名(不带前缀目录名的名称)。


I have found some examples that explains how to make input type=file to be non editable. like <input type="file" onkeydown="blur()" />

But I made test application in Visual Studio and find out that <input type="file" /> in non editable by default.

How to make it editable?

thanks

解决方案

The behavior of <input type="file"> elements is very strictly controlled by browsers, and you cannot force them to do anything other than what they want to do. Generally, modern browsers will only allow a file picker to be used for selecting a file for upload. Your Javascript code can't set the value and can't see anything more than the tail file name (the name without prefixing directory names).

这篇关于如何制作&lt;输入类型=&quot;文件&quot; /&GT;编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆