问题描述
我找到了一些解释如何使input type = file不可编辑的例子。
like < input type =fileonkeydown =blur()/>
但是我在Visual Studio中做了测试应用程序,发现在默认情况下不可编辑的< input type =file/> 。 b
如何使它可编辑?
谢谢
< 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).
这篇关于如何制作<输入类型="文件" />编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!