开发者

Problems with response of the form after upload file

when i receive a response from the server without that is not handle by AJAX i have a problem to catch the data, normally the data goes to the target but that only happens in Chrome, the other browsers open a new tab and insert the response in the new tab, my question is how i can avoid that? i wanna insert on the target, the code below is the code of the page and the javascript that trigger the submit.

Here is the code of the form.

<div>
  <form id='uploadFrm' action='/'enctype='multipart/form-data' method='POST' target='frame_trgt'>
<input id='1_inp' name='upfile' type='file' />
<input id='pathFile' type='input' name='path' />
<开发者_运维技巧;input id='uploadFile' type='submit' /><br />
 </form>
 <iframe id='frame_trgt' name='frame_trgt' />
</div>

Here is the code of the JavaScript that handle the upload file.

$('[name=upfile]').change(function(event){
        $("#pathFile").attr('value', getData('carpet'));
        $("#uploadFile").trigger('click');
    });


i believe you just need to close your iframe tag

<iframe id='frame_trgt' name='frame_trgt'></iframe>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜