1

I have an input type=file that is clicked by the onclick event of a button.

When the form containing this input is submitted, IE 10 has issues - the file input gains focus AND loses its value - and the form is not submitted.

Edit: The file browser does open, and it does gain the value, it just loses it on submission.

I'm hoping for a solution, if not, a different method of achieving the same results.

Here is the code:

<form action=".." method="post" enctype="multipart/form-data">
    <input type="file" id="file" name="file">
    <button type="button" onclick="$('#file').click();">Upload File</button>
    <button type="submit">Submit</button>
</form>

In actuality I have #file hidden (hence the .click()), but I know that's not the issue, because I tested it with #file visible as well. I think the .click() is causing the problem somehow, but I need a workaround.

1 Answers1

-2

If you want your upload button to be styled try this " input style "