Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to use createElement(); In child window for opener window?

Posted on 2002-04-09
10
Medium Priority
?
266 Views
Last Modified: 2008-03-06
Dear Friends,
I have one dropdown list box in parent window. I want to
insert options into that from child window.  
I am using window.open() for opening child window.
I can able do it in parent window with
/********************************************
xx = document.createElement("OPTION");
xx.text="yogi"
xx.value="yogi"
document.frmName.listName.add(xx);
/********************************************

But Please Tell me how it is posibile from child window?
I tried with opener.createElement("OPTION"); It is not allowing..........

IN SHORT
 how to use createElement(); In child window for opener
window?
0
Comment
Question by:mail2yogi1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 6928401
from the child:

opener.document.frmName.listName.add(xx);
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 6928405
oops ... try this:

if ( self.opener && !self.opener.closed )
  self.opener.document.frmName.listName.add(xx);
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 6928417
and if that doesn't work, then do this ...

first, give the parent window a name, so in the parent window, do this:

<BODY onLoad='self.name="theParent";'>


then in the child, do this:


if ( !self.opener )
   self.opener = window.open("","theParent");  // get handle to parent

if ( self.opener && !self.opener.closed )
   self.opener.document.frmName.listName.add(xx);
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:mail2yogi1
ID: 6928427
Actually I am dynamically creating dropdown list box in parent window. and in child window I want to add elements in to it. So I must have to use createElement function.

So How to use it. This is same question as above. In other way.
Thanks,
0
 
LVL 12

Expert Comment

by:ahosang
ID: 6928437
In parent write the function:
<script>
function adder(t, v) {
  xx = document.createElement("OPTION");
  xx.text=t;
  xx.value=v;
  document.frmName.listName.add(xx);
}
</script>

In child call this:

opener.adder("yogi", "yogi");
0
 
LVL 1

Author Comment

by:mail2yogi1
ID: 6930318
Hey noboday knows to use createElement().........

Its very Urgent ....
Yogi
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 6931067
what is the error?
0
 
LVL 1

Author Comment

by:mail2yogi1
ID: 6931370
Dear knightEknight  Thanks.
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 200 total points
ID: 6931405
what error message are you seeing?
0
 
LVL 1

Author Comment

by:mail2yogi1
ID: 6933980
Thanks, knightEknight for helping in time.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question