I have set the target of the "pic_form" to a div (pic_target). The form (pic_form) and the div (pic_target) are both inside the same iframe (iframe_pic). Whatever I set the target to of the "pic_form", a new page pops up and there is my php script (imageUpload.php) output... WHY?
Here is my main page code:
<form><iframe name="iframe_pic" src="iframe.html"></iframe></form>
Here is my iframe.html:
<script type="text/javascript">
function reset_imageform(){
f = document.getElementById("pic_form");
f.src=f.src;
}
</script>
</head>
<body><form target="pic_target" name="pic_form" id="pic_form" enctype="multipart/form-data" method="post" action="bincgi/imageUpload.php"><input name="pic_file" type="file" id="pic_file" size="35" onChange="this.form.submit();"></form><div id="pic_target" name="pic_target"></div>
and here is some of my php file imageUpload.php:
$display_image="<img src='../temp_images/$newfilename'>";
$display_image.="<br><a style='font-weight:bold; font-size:12px;' href='#' onclick='window.parent.reset_imageform();'>remove picture</a>";
echo $display_image;
Thanks
IF you need more of the PHP file, just tell me...