0

I am having some strange issues with my code as it only works in Internet Explorer 11 (only tested in 11) and it is NOT working in Firefox 25.0.1 or Chrome 31..

I want my form to submit in the iframe so I can handle image uploads in the background.. But I'm not getting far thanks to this issue.

Here's my code:

<form method="post" action="/components/com_jshopping/templates/hb/product/ajax/uploadImage.php" id="uploadImageForm" enctype="multipart/form-data" target="HBUPLOADFRAME">
    <input type="hidden" name="uploadImage" value="UPL">
    <input type="file" name="image" id="imgUploadFile">
</form>
<iframe name="HBUPLOADFRAME" id="imgUploadFrame" src="/components/com_jshopping/templates/hb/product/ajax/uploadImage.php" height="50" width="300" style="border: 0;"></iframe>

<script type='text/javascript'>
    jQuery(document).on('change', '#imgUploadFile', function() {
        jQuery("#uploadImageForm").submit();
    });
</script>

Thanks in advance!

  • Why are you doing that? Don't do that – Paul Dessert Dec 10 '13 at 10:02
  • I think your comment is not helping my issue.. :-) - why don't you come with a suggestion that can help me out? Like how would you it? Because I want a direct upload so I can get the image directly after picking one and uploading it. After that I'm giving the user the option to crop out the image and save it afterwards.. So I'm waiting for your suggestion. – Björn Vermaeren Dec 10 '13 at 10:03
  • I guess you can check the solution in this [post](http://stackoverflow.com/questions/168455/how-do-you-post-to-an-iframe) – Odin Dec 10 '13 at 10:07
  • I've read that already.. No solution for this problem.. I just don't understand why it IS working in IE and not in FF or Chrome... Most times it is IE where it would not be working but this time it only is working in IE.. – Björn Vermaeren Dec 10 '13 at 10:14

0 Answers0