Forums Register Login

How to call parent window id in child window

+Pie Number of slices to send: Send
Hi

I need to call parent hidden field in child window. How do I do that in JavaScript?
+Pie Number of slices to send: Send
looks like there is no other way than sending the data from parent while opening the child window. They cannot be in sync until there is request to your server(in sync or async using ajax) to update/read parent and populate the same in child.
+Pie Number of slices to send: Send
could you please tell me how do i send parent data to child window when i open a child window?
+Pie Number of slices to send: Send
what is there in it? Am i missing something? Am on the same page as yours..

Anyways, it is same as how you get the data in your parent read, it from the infrastructure of your application. It can be from any scope - the application (retrieve from the static variables in child window), session(retrieve from the session which you would set before opening child window), request (same from request). how to set these values in different scope is the actual story. Say if you are not processing any request in the server side to open the (somewhat called static JSP) child then you can just put it in the URL (like childURL?parameterName=value) but it is not recommended for security reasons and not a good practice.
+Pie Number of slices to send: Send
 

sravani gogineni wrote:Hi

I need to call parent hidden field in child window. How do I do that in JavaScript?



Do you want to send the field or the field value (content)??
If you want to pass the field content, I think that you would must to try passing the parameter by url similar to this
I think you won't have problems if the new windows is a popup (child)

+Pie Number of slices to send: Send
Thanks jhon, i was having the prepective that the child is a popup/newwindow being opened from javascript
+Pie Number of slices to send: Send
I need to place a hidden field in main page and child page for storing the session id. i want to compare both and see if they are equal then proceed else go to login page.
+Pie Number of slices to send: Send
 

sravani gogineni wrote:I need to call parent hidden field in child window. How do I do that in JavaScript?


You don;t "call" fields so what is it you are really trying to do?

Perhaps change the value of the field from the child? If so, you can find a reference to the parent window in the opener variable.
+Pie Number of slices to send: Send
 

Bear Bibeault wrote:

sravani gogineni wrote:I need to call parent hidden field in child window. How do I do that in JavaScript?


You don;t "call" fields so what is it you are really trying to do?

Perhaps change the value of the field from the child? If so, you can find a reference to the parent window in the opener variable.



I tried using this :
var test =window.opener.document.getElementById('field1').value;
alert(test);

but the alert box is not seen
+Pie Number of slices to send: Send
What does the JavaScript console show? Any errors?

Check each part of your reference chain to make sure that things are evaluating to what you think they are supposed to.
+Pie Number of slices to send: Send
JS console ? how do i look at it? As of now i dont see any errors in the left hand corner of the window.
+Pie Number of slices to send: Send
If you are writing JavaScript you need to become familiar with the tools necessary. For Firefox, download Firebug. Chrome, Safari and IE8/9 come with their own debuggers.
+Pie Number of slices to send: Send
I dont see any errors in the console.
+Pie Number of slices to send: Send
Start checking each step in your reference. Does each step evaluate to what you think it does?
That is a really big piece of pie for such a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3074 times.
Similar Threads
could't access DIV TAG attribute
Calling parent function when user closes child window
Add and Edit a row
dynamic DIV tag
Popup window not working
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 07:31:53.