Pop-up and parent communication

G

gayatri_choda

Hi,
I am calling a pop -up ( a jsp page) window with the Window.open
method from the parent ( a jsp page) . My pop-up window contains some
input fields. Now on clicking the "Ok" button in the pop-up all the
values should be added to the parent window and the pop-up should be
closed. I am able to close it but the parent is not getting refreshed.
Please ....Please help me out on this issue. I am in very big need.
I used target="_parent" and target="_top" but it did not worked :-(

window.opener.getelementbyId(X).value= window.open.filedname.value ;
also has no result!!!

The values should go to the server first and then page should be
refreshed.
Please help me out on this issue.
 
L

Laurent Bugnion

Hi,

Hi,
I am calling a pop -up ( a jsp page) window with the Window.open
method from the parent ( a jsp page) . My pop-up window contains some
input fields. Now on clicking the "Ok" button in the pop-up all the
values should be added to the parent window and the pop-up should be
closed. I am able to close it but the parent is not getting refreshed.
Please ....Please help me out on this issue. I am in very big need.
I used target="_parent" and target="_top" but it did not worked :-(

It didn't because _parent and _top are keywords used with frames.
_parent is the frameset containing a frame, and _top is the top window,
containing all framesets.

window.opener.getelementbyId(X).value= window.open.filedname.value ;
also has no result!!!

Are you just trying random code and hope it works?

JavaScript is case sensitive. Besides, opener is a Window object, and
getElementById is a method of the Document object, so it would be

window.opener.document.getElementById( "..." ).value

window.open is a method, and has no "filedname" property. You can try:

window.opener.document.getElementById( "..." ).value =
document.getElementById( "..." ).value;

The values should go to the server first and then page should be
refreshed.

The JavaScript is clearly not the way to go here, since the values will
remain on the client (no round trip).

You must first name your main window (window.name = "abcd";).

Then in the popup, use:

<form name="mainForm" target="abcd" ...

Please help me out on this issue.

I recommend that you buy / find a tutorial about HTML, JavaScript, the
DOM Level 2. Contrarily to what many seem to think, they are not
low-level languages, and must be learned. JavaScript is, for some
aspects, at least as complex than C#.

HTH,
Laurent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top