By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,946 Members | 1,600 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,946 IT Pros & Developers. It's quick & easy.

Pass selected <TD> value from child to parent window

P: n/a
Hi,

I am opening a pop up window (child) from a parent window.
The Child window does show a table with multiple columns and rows, each
showing a value, e.g. 9 or 10 or etc. I have the values as hyperlinks, so
that if a number is selected in the child window it should close
automatically and insert the selected value in a text field in the parent
window.
I have created following code, but does not work.
Any ideas why or other approaches ?
Thanks.

that is how I open the child window:

newwindow = window.open("0to100kbs.htm" , "popup1",
"width=350,height=350,screenX=200,screenY=200,top= 200,left=200",
"alwaysRasied");

my table data in the child window:
"..... <TD><a href="#" onClick="sendInfo (this.innerHTML);">5</a></TD>"

and the javascript on the child window:

function sendInfo(name) {
window.opener.document.6Cos.ef.value = name;
self.close(); }
where as 6Cos is the form name in my parent window and ef the text field
name.

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Filiz Duman wrote:
I am opening a pop up window (child) from a parent window.
The Child window does show a table with multiple columns and rows, each
showing a value, e.g. 9 or 10 or etc. I have the values as hyperlinks, so
that if a number is selected in the child window it should close
automatically and insert the selected value in a text field in the parent
window. window.opener.document.6Cos.ef.value = name;


I think that the name "6Cos", while valid HTML, might be the problem, at
least as you reference it; an identifier starting with a number in
javascript, cannot indeed be referenced using the dot notation.
Therefore, you need to use the square bracket notation, or to change the
identifier's name.

window.opener.document.forms["6Cos"].elements["ef"].value = name;
HTH
Yep.
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.