Problem with file submission via ajax into an iframe - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Problem with file submission via ajax into an iframe (/showthread.php?tid=11572) |
Problem with file submission via ajax into an iframe - El Forum - 09-14-2008 [eluser]m4rw3r[/eluser] I'm trying to submit a form with a file upload in it via ajax. It's not going so well (I'm getting a bit pissed at the different browsers), but I've got it to work partially in Firefox and Safari (two clicks). The code below is partially borrowed from phpletter's jQuery plugin, but I needed to be able to send both a file and fields at the same time. Here is the JS (may be messy): Code: bind_ajax_to_share_forms = function(){ Then the onload event occurs for about:blank, causing the callback to be triggered. This makes the form disappear after the original have been replaced with the "No Response" text. But if you comment the remove() calls, it will work partially. Everything goes like before, but the copied form stays, which you then can submit and the onload triggers as it should. What am I doing wrong? Phpletter's plugin seems to work, and my code is almost identical in the sections that matter. Thanks in advance. Problem with file submission via ajax into an iframe - El Forum - 09-14-2008 [eluser]m4rw3r[/eluser] Ok, I think I got the problem solved: I need to get the JS to click the form button instead of submitting the form. Code: /// replace: It seems to work in both IE, Firefox, Chrome and Safari. But Opera still thinks I want to have the content of about:blank. |