Jump to content

Ie Issue - Sending Form To Iframe


djp1988
 Share

Recommended Posts

I have a photo upload page, and I send the form, to a page but target it so it executes within an iframe, everything in theory is working fine.However in IE7 this process seems to be very unreliable.When you submit the form, a loading gif appears and the style of the form is set to none so you can't click more then once per upload.The upload_process page then handles the form info, and should an error happen, or not the whole form was filled out, these info are alerted buy echoing a javascript with alert, and also trigger a function in the parent window, to make the loading gif to go away and show the form again.But sometimes in IE, the browser seems to be unable to open the upload_process page, I don't know why, it works 100% of the time in safari and firefox... but in IE this error seems to happen 1 in 3 times.The real problem is that because the document isn't loaded, the javascript to get the form back isn't triggered, and so, if this happens it's game over and you have to reload the page.I first thought that maybe because the iframe had display:none, IE could be not dealing with it, but sometimes it works with it set to display:none, so the problem isn't there...Also my IE,sems to act strange, it's in a virtual machine (im on mac), and at the moment, my site is protected by .htpassword, and my top background image the banner, doesn't appear at all, as with all other browsers on the virtual machine (safari, opera, chrome, IE), I thought maybe this is because of the .htpassword, but it's only this background image that doesn't appear. Could the same kind of thing be happening to the file for the iframe? maybe it's coming accross a denied access? But if this is true number 1 - i should get a promt for username / password, and 2- it should fail 100% of the time ?To give you a better idea of the occurance of this problem, I tried it multiple times:WORKEDWORKEDWORKEDWORKEDWORKED=page reload=WORKEDFAILED=page reload=WORKEDFAILED=page reload=WORKEDFAILED=page reload=WORKEDFAILED=page reload=FAILED=page reload=WORKEDWORKEDWORKEDWORKEDWORKED

Link to comment
Share on other sites

<iframe src="" style="display:none;" name="process_form"></iframe><form method="post" action="process.php" target="process_form" enctype="multipart/form-data"><input type="hidden" name="MAX_FILE_SIZE" value="1000000"  /><input type="file" name="thefile" id="upload_me" size="30" /><input type="submit" value="Upload photo" /></form>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...