我有这个表格html:
<form id="testForm" method="post" action="upload.php" target="upload_target" enctype="multipart/form-data" style="margin-bottom:0;">
<textarea name="infoText"></textarea>
<input id="file-input" name="bid-file" type="file" style="visibility:hidden;">
<input type="submit" id="submitBtnFile" style="visibility:hidden;">
</form>
<button id="#submitBtn">Submit</button>
<iframe id="upload_target" name="upload_target" src="#" style="width:0;height:0;border:0px solid #fff;"></iframe>
我的js是:
$('#submitBid').click( function(){
$('#objectCommentsSubmit').trigger('click');
$('#submitBtnFile').trigger('click');
$('.loading-bid').show();
});
这适用于Safari,Firefox和Chrome,但不适用于IE!
有人能告诉我IE的错误吗?
谢谢!
答案 0 :(得分:1)
尝试更改
$('#submitBtnFile').trigger('click');
到
$("#testForm").submit();