Javascript 如何在单击';取消';?它在浏览器中工作,在chrome中不工作
单击“取消”后,文件仍卡在那里。 在浏览器中它可以工作,但在chrome中我找不到任何方法来清除输入文件。 代码是: 请帮忙 这是我的密码:Javascript 如何在单击';取消';?它在浏览器中工作,在chrome中不工作,javascript,html,google-chrome,file-io,Javascript,Html,Google Chrome,File Io,单击“取消”后,文件仍卡在那里。 在浏览器中它可以工作,但在chrome中我找不到任何方法来清除输入文件。 代码是: 请帮忙 这是我的密码: var AddFileWindow = $('#AddFileWindow').kendoWindow({ title: 'Add File', visible: false, modal: true, width: 440, height: 450, resizable: false, action
var AddFileWindow = $('#AddFileWindow').kendoWindow({
title: 'Add File',
visible: false,
modal: true,
width: 440,
height: 450,
resizable: false,
actions: [
"Close"
],
activate: function () {
$('#AddFileWindow').show();
},
close: function (e) {
clearAddFileWindow();
}
}).data('kendoWindow');
function clearAddFileWindow() {
var fileInput = $('#frame-files');
fileInput.replaceWith(fileInput.val(''));
$("#machine-file").data("kendoDropDownList").select(0);
$("#material-file").data("kendoDropDownList").select(0);
document.getElementById("material-group").style.display = "none";
document.getElementById("alert").style.display = "none";
document.getElementById("Notes-file").value = "";
}
<div id="AddFileWindow" style="display:none;">
<div class='k-edit-label'>
<div class="form-horizontal form-widgets col-sm-10" style="margin-left:15px;">
<div class="form-group">
<div class="fileinput fileinput-new input-group" data-provides="fileinput" style="margin-top:10px">
<div class="form-control"><i class="fa fa-file-text-o fileinput-exists"></i> <span class="fileinput-filename"></span></div>
<span class="input-group-addon btn btn-primary btn-file">
<span class="fileinput-new">Select file</span><span class="fileinput-exists">Change</span>
<input id="frame-files" style="height:70px" type="file" name="...">
</span>
<a href="#" class="input-group-addon btn btn-primary fileinput-exists" data-dismiss="fileinput">Remove</a>
</div>
</div>
</div>
var AddFileWindow=$(“#AddFileWindow”).kendoWindow({
标题:“添加文件”,
可见:假,
莫代尔:是的,
宽度:440,
身高:450,
可调整大小:false,
行动:[
“结束”
],
激活:函数(){
$('#AddFileWindow').show();
},
关闭:功能(e){
clearAddFileWindow();
}
}).数据(“kendoWindow”);
函数clearAddFileWindow(){
var fileInput=$(“#框架文件”);
fileInput.replaceWith(fileInput.val(“”));
$(“#机器文件”).data(“kendoDropDownList”).select(0);
$(“#物料文件”).data(“kendoDropDownList”).select(0);
document.getElementById(“物料组”).style.display=“无”;
document.getElementById(“警报”).style.display=“无”;
document.getElementById(“Notes文件”).value=“”;
}
选择文件更改
请显示您的代码编辑您的问题并在中发布代码it@user4810410请你的问题,并把那里的代码(如果可能的话,也提供你的HTML)可能的重复作品为我。只需调用函数:请显示您的代码编辑您的问题并在中发布代码it@user4810410请你的问题,并把那里的代码(如果可能的话,也提供你的HTML)可能的重复作品为我。只需调用函数: