function direct()
{
var x= document.getElementById('fileupload-example-4').value ;
var String=x.substring(x.lastIndexOf("\'")+1,x.lastIndexOf("."));
alert(x);
alert(String);
document.getElementById('filedirect').value=String;
}
<div class="input-group">
<input type="text" id="filedirect" readonly style="width:260px; height:30px;border:0px;">
<span class="input-group-btn" style="width:0px;"></span>
<input type="file" id="fileupload-example-4" onchange="direct()" multiple> <label id="fileupload-example-4-label" for="fileupload-example-4">ADD</label></div>
我正在为表单制作一个多文件上传输入字段。我想制作一个复选框,允许用户取消选择或添加更多文件。如何制作这样的文件上传输入框
最佳答案
不需要自己写,可以使用插件如:
关于javascript - 我想在提交之前制作一个复选框来编辑多文件上传输入字段的选定文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33328933/