Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/395.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在Internet Explorer中上载文件失败_Javascript_Jquery_File Upload - Fatal编程技术网

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">&nbsp;</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);
            });
    });