the dialog window is a div with id "pic_dialog" It contains the form, the iframe and the feedback div
Code: Select all
<div id = "pic_dialog">
<form enctype="multipart/form-data" action="picture_upload.php" target = "picture_upload_iframe" method="post">
<div> Upload A Picture </div>
<input name="MAX_FILE_SIZE" value="10000000" type="hidden">
<input name="picture" accept="image/jpg, image/png, image/jpeg, image/bmp, image/gif, video/*" type="file">
<button class = "button" name="submit" type="submit"> Submit! </button>
</form>
<iframe name="pic_upload_iframe" src="" style="visibility:hidden;"></iframe>
<div id="pic_upload_feedback"> </div>
</div> <!--closes pic dialog>
Then at the end of the picture_upload.php script which handles the form, after checking if the picture has uploaded successfully, I include this line to send the feedback. The session variables are the error/succees variables
Code: Select all
<?php
//...A whole lotta ommitted code
print "<script type='text/javascript'>
$('#pic_upload_feedback', window.parent.document).html(<div>".$_SESSION['error'].$_SESSION['pic_upload_success']."</div>);
</script>";
?>
Thanks.