StefanRSA Posted October 15, 2009 Share Posted October 15, 2009 I am working on an image upload form and am using straight php to do the upload. It works without a submit button button to do the actual submitting but <input size="10" type="file" name="img1" onchange="image.submit();" > and the form submit to itself This form is embedded in another form. When I select a file in the iframe - Form, the upload starts but nothing else happen. When the file is uploaded the iframe reloads itself, flash white before it goes tranparent and continue with the code.... How can I [*]Display an image with file upload [*]Stop the ugly with flash Any suggestions please! Link to comment https://forums.phpfreaks.com/topic/177782-solved-display-image-on-iframe-when-reloadrefresh-with-php/ Share on other sites More sharing options...
johnsmith153 Posted October 15, 2009 Share Posted October 15, 2009 Can you re-phrase this? I think you are uploading a form to a php script. The form is in an iframe. Not sure what you are asking after that. How can I Display an image with file upload Stop the ugly with flash ..none of which makes sense. Do you mean: How can I display the image that has just been uploaded? How can I prevent the iframe reloading and showing a white screen for a second or so? Can't imagine there should be a big issue with a white screen, unless it is taking ages to download and display the new image. Possible solutions: (1) Depending on the name of the form etc. "image.submit()" may be the problem with why it won't auto-submit. (2) If you must use an iframe, how about submitting the file upload via Ajax, displaying a "Please Wait" whilst it is processing, then display the image when completed (in your iframe). This will resolve any white screen issues and displaying of the image. Link to comment https://forums.phpfreaks.com/topic/177782-solved-display-image-on-iframe-when-reloadrefresh-with-php/#findComment-937444 Share on other sites More sharing options...
mrMarcus Posted October 15, 2009 Share Posted October 15, 2009 you cannot embed HTML forms .. browsers hate that. separate your forms and we can go from there. Link to comment https://forums.phpfreaks.com/topic/177782-solved-display-image-on-iframe-when-reloadrefresh-with-php/#findComment-937445 Share on other sites More sharing options...
StefanRSA Posted October 15, 2009 Author Share Posted October 15, 2009 The image is already displayed after upload fine... I want an animated image to display while the image uploads.... Mr Marcus, This is a members form and in the members form is an Iframe. Thie iFrame src points to an image upload form (The one you helped me with yesterday). The total images that can be uploaded changes depending on the category a user has chosen... but by default 4 images... So... When a member select a file to upload, I want to display a "animated loading" gif while the file uploads until the complettion of upload, where the upload form refresh to display the uploaded image.... Link to comment https://forums.phpfreaks.com/topic/177782-solved-display-image-on-iframe-when-reloadrefresh-with-php/#findComment-937529 Share on other sites More sharing options...
StefanRSA Posted October 16, 2009 Author Share Posted October 16, 2009 My My.... To those thinking that this cannot be done.... The answer is simple! In your head section paste the following: <script language="javascript" type="text/javascript"> <!-- function showProgress() { document.getElementById("progress").style.visibility = 'visible'; } //--> </script> And use the function on OnClick or Onselect depending on the need like follow: <input size="10" type="file" name="img1" onchange="image.submit(); javascript:showProgress();" onclick=""> And ad the image in a <span> where needed.... like: <span id="progress" style="visibility:hidden"><img src="../images/ajax-loader.gif"/></span> Link to comment https://forums.phpfreaks.com/topic/177782-solved-display-image-on-iframe-when-reloadrefresh-with-php/#findComment-937886 Share on other sites More sharing options...
johnsmith153 Posted October 16, 2009 Share Posted October 16, 2009 My My.... To those thinking that this cannot be done.... The answer is simple! Nobody said it can't be done. The problem is nobody understood what you were on about. Your English is very poor (in the first post anyway). Link to comment https://forums.phpfreaks.com/topic/177782-solved-display-image-on-iframe-when-reloadrefresh-with-php/#findComment-937975 Share on other sites More sharing options...
StefanRSA Posted October 16, 2009 Author Share Posted October 16, 2009 So So Sorry!!! I am trying! I am self taught... With MAJOR help from phpfreaks.com Members! Thanks... Link to comment https://forums.phpfreaks.com/topic/177782-solved-display-image-on-iframe-when-reloadrefresh-with-php/#findComment-938013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.