In main form i fire the even :
Code:
<a href="JavaScript:openWindow('admin_upload.do?dir=products&formTarget=frmAddMobile&elementTarget1=txtImgPre&elementTarget2=imgPre')">
<img alt="Upload" name="imgPre" border="1" src="<%=eProductDetail.getImage1()%>" width="150" style="border: 1px solid #C0C0C0;">
</a>
<input name="txtImgPre" type="hidden" value="<%=eProductDetail.getImage1()%>">
when i click image, new popup window will display and in window popup i request all variables
Code:
<%
    String qStrDir=request.getParameter("dir");
    String formTarget=request.getParameter("formTarget");
    String elementTarget1=request.getParameter("elementTarget1");
    String elementTarget2=request.getParameter("elementTarget2");
%>
<script language="JavaScript">
<!--
function insertPic(strValue){
    window.opener.document.<%=formTarget%>.<%=elementTarget1%>.value=strValue;
    window.opener.document.<%=formTarget%>.<%=elementTarget2%>.src="../images/<%=qStrDir%>/"+strValue;
}
</script>
after finished up load i can get file image name
Code:
<input onclick="javascript:insertPic('<%=fname%>');window.close();" type="button" value="Insert" name="Close1">
when i click insert only the popup window close but not insert image in main window