Solved

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

Posted on 2002-04-09
10
261 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
  • 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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 50 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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
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…

777 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