Javascript 在Internet Explorer中上载文件失败
当我试图创建上传文件时,我创建了输入字段,一个按钮和输入类型文件被隐藏Javascript 在Internet Explorer中上载文件失败,javascript,jquery,file-upload,Javascript,Jquery,File Upload,当我试图创建上传文件时,我创建了输入字段,一个按钮和输入类型文件被隐藏 <input type="text" name = "filePath" id = "filePath" class="regCustVATTextbox" style="width: 120px;" onfocus="javascript:this.blur();"> <button type="button" class="hochladenBut
<input type="text" name = "filePath" id = "filePath" class="regCustVATTextbox" style="width: 120px;" onfocus="javascript:this.blur();">
<button type="button" class="hochladenButton" id="btnRegUploadFile"> </button>
<input type="file" name="fileRegHid" id="fileRegHid"/>
当我提交表单时,FF和Chrome都能很好地工作,但在IE上,type input fie中的值被删除,我必须单击两次才能提交表单
请帮助我,给我任何解决这个问题的想法
非常感谢最后,你会喜欢IE的。我不太喜欢IE,但是这个功能应该在不同的浏览器中运行良好。我认为这是IE的一个缺陷,不是吗?
$(function(){
$("#btnRegUploadFile").click(function(){
$("#fileRegHid").click();
return false;
});
$("#fileRegHid").change(function(){
var filename = $(this).val().replace(/C:\\fakepath\\/i, '');
$("#filePath").val(filename);
});
});