0

When I try to create upload file, I create input field, a button and input type file is hidden

<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"/>

And Jquery Code

    $(function(){                               
            $("#btnRegUploadFile").click(function(){
                $("#fileRegHid").click();                   
                    return false;
            });

            $("#fileRegHid").change(function(){
                var filename = $(this).val().replace(/C:\\fakepath\\/i, '');
                $("#filePath").val(filename);
            });
    });

When I do the form Submit, FF and Chrome work well but on IE, value inside type input fie is deleted and I must click twice times to submit form.

Please help me and give me any idea to resolve this problem.

Thanks very much

4

0 回答 0