hi
i want to upload photos.
i have a upload button when the upload button is clicked a window will pop out and uploading image option are there.
when the close window buttton is clicked in the pop up,i want to close the pop up and the path should be displayed as a link in the parent window
this is my code.where uploading is working but i am not able to close the window when close button is clicked and dont know how to display the link in the parent page......

child window

<?
      echo '<script language="javascript">';
      echo 'function updateparent(path,button) {';
      echo 'window.opener.document.stylist_reg_details.'.$_REQUEST['textbox'].".value=path;";
	  echo 'var targ="link_'.$_REQUEST['textbox'].'";var obj_styphoto = window.opener.document.getElementById("targ");';
	  echo 'alert ("Target = " + targ);';
	  echo 'alert (obj_styphoto);';
	  echo 'obj_styphoto.href=path; obj_styphoto.style.display = "block";';
      echo 'window.close();';
      echo '}</script>';
    ?>

parent window

workphoto1:<input type="text" readonly="readonly" name="workphoto1" class="story" size="35" />&nbsp;<INPUT type="button" value="Upload" onClick="alert('we support only JPG format');window.open('uploadpicture.php?stylistid=<?echo $stylistid;?>&textbox=workphoto1','mywindow','width=500,height=300')" />

child window
<form action="uploadpicture.php?stylistid=<?echo $_REQUEST;?>&textbox=<?echo $_REQUEST;?>" method="post" ENCTYPE="multipart/form-data">
File: <input type="file" name="stylistphoto" size="30">
<input type="submit" value="Upload!">
</form>

when the close window buttton is clicked in the pop up,i want to close the pop up and the path should be displayed as a link in the parent window

What do you mean by "Path should be displayed as a link to the parent window" do you mean if you hover the mouse over the link that it shows the URL? That would be taken care of as a "title" tag in the anchor tag.

This article has been dead for over six months. Start a new discussion instead.