Jquery .submit() event to firing

荒凉一梦 提交于 2019-12-02 14:56:30

问题


HTML

<form action="includes/photos.php" id="joinPhotoUploadForm" enctype="multipart/form-data">
  <input type="file" name="file" id="file"><br>
</form>

Jquery

$('div#photoCropContainer').click(function() {
  $('input#file').trigger('click');
});

And

$(document).on('change','input#file', function() {
    alert('ready to upload');
    $('form#joinPhotoUploadForm').submit();
});

When someone clicks the Div@photoCropContainer it trigers a click on the file input, shows the popup and sends the file. This works on FF & Chrome.

On IE9 however I always get the popup but no other reply...

Can anyone give me any advise?

thanks


回答1:


As I can see in IE9 console "access denied" on form submit line, thats why nothing works. Look at this question ie javascript form submit with file input



来源:https://stackoverflow.com/questions/12444648/jquery-submit-event-to-firing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!