I have a page ( demo ):
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="http://codeorigin.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(function() {
$("#id_button").click(function(e) {
$("#id_file").click();
});
});
</script>
</head>
<body>
<form method="post" enctype="multipart/form-data" action="http://www.google.com/">
<input type="file" name="file" id="id_file" />
<input type="button" id="id_button" value="fake button" />
<input type="submit">
</form>
</body>
</html>
if I open the browse dialog by clicking the "fake button", select the file (I see it in input[type="file"]), and not the submit button and nothing happens, it input[type="file"]is cleared.
What should I change to make it work?
I get this problem in IE8 and IE10.
PS: the file input will be hidden, so the user will only work with a fake button.
source
share