我在通过IE 8提交HTML表单时遇到了麻烦。这有点奇怪,因为它在firefox中运行得非常好。当我点击提交按钮时没有任何反应。
HTML代码:
<html:form action="/jsp/fileUploadAction" method="POST" enctype="multipart/form-data" name="fileUploadForm" type="com.fileuploadtest.form.FileUploadForm">
<input type="file" name="files[0]" style="display: none;" onchange="javascript:selectFiles(0);" id="file0"/>
<input type="button" value="Upload" id="uploadButton" />
</html:form>
<h5 style="text-align:center"><i style="color:#ccc"><small>Max File Size: 2 Mb - Display last 20 files</small></i></h5>
<table id="uploaded-files" class="table" border="1" cellspacing="1">
<tr>
<th>File Name</th>
<th>Cancel Action</th>
</tr>
</table>
<table>
<tr>
<td colspan="2"><input type="submit" id="btnSubmit" value="Upload All" /></td>
</tr>
</table>
JQuery代码:
$("#btnSubmit").click(function () {
alert('Button clicked');
$( '[name="fileUploadForm"]' ).submit();
});