Help me how to making a page load itself into a new popup window ???

love4all1080's Avatar, Join Date: Mar 2009
Newbie Member
Hi everyone,

I need your help.

I'm sure this is a very simple problem but I can't figure it out.

Ok, I have a main window where a user fills in a form....


When submitted it goes onto another page and has two options:

"remove"

and

"attach a picture [choice]"

When a user clicks on attach a picture it opens up in a pop up window....

Now what i want it to do is let the user attach a picture and when they click on insert

the page will load in the main window - the window that had the link to the pop-up - if that makes any sense...

I had a little bit of Java to close the window, but I want it to close and open the page in the main window...

If anyone can understand that please help me
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Check out the Javascript code for the Manage Attachment button code in the New thread / Reply page in this forum
love4all1080's Avatar, Join Date: Mar 2009
Newbie Member
i using JAVA but i want some code javascript help me insert image in main window when open new popup window.you can see link and help me
http://love4all1080.blogspot.com/200...-into-new.html

i can post link here. remove space when you click link
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
You have posted in JavaScript forum and I moved it to the Java forum.

I made the link clickable and you would be able to post links after getting up with your post count.

Now for the solution you have to fire the event which displays the event in the thumbnail with the param as the url to the image
love4all1080's Avatar, Join Date: Mar 2009
Newbie Member
no one helped me do I need it in a presentation a few days with programming language Java - Desktop Ajax
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by love4all1080 View Post
no one helped me do I need it in a presentation a few days with programming language Java - Desktop Ajax
You need to do this. Now for the solution you have to fire the event which displays the event in the thumbnail with the param as the url to the image
love4all1080's Avatar, Join Date: Mar 2009
Newbie Member
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

shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
You have this

window.opener.document.<%=formTarget%>.<%=elementT arget2%>.src="../images/<%=qStrDir%>/"+strValue;

And check if all the variables are correct.

or else this can be done simply by using plain JavaScript

Name the image with some id and then assign the src of that id to the image value

../images/<%=qStrDir%>/"+strValue