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 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>
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;
READ: As you can see I am trying to call javascript inside iframe.html to reset the form. This is because after all my php, the image shows, and I want the user to be able to click a link and then the form gets resetted and the user can chose another picture to upload.
Should I reset the form (pic_form) or should i reload the entire iframe (iframe_pic) that contains the 'pic_form'? And any code would be appreciated on how to do this, if anybody knows?
Thanks