Easiest javascript code ever...but why can't I get it working?

P

Phantom_skulcave

Hi all. I know you'll probably laugh at this, but I can't get a simple child
browser to get the information from the parent browser.

I'm familiar with JavaScript, but let's just say, not fluent (to put it
mildly).

I've seen examples that say this should work:

var a = document.FirstForm.TextBox3.value;
this.TextBox3.value = a

But it just won't transfer the data on 'OnLoad'.

Can someone please help? Thanks, all.
 
G

Guest

Hi all. I know you'll probably laugh at this, but I can't get a simple child
browser to get the information from the parent browser.

I'm familiar with JavaScript, but let's just say, not fluent (to put it
mildly).

I've seen examples that say this should work:

var a = document.FirstForm.TextBox3.value;
this.TextBox3.value = a

But it just won't transfer the data on 'OnLoad'.

Can someone please help? Thanks, all.

try to use window.opener.document.getElementById("id_here").value
 
K

Kevin Spencer

What do you mean by "child browser?" If you're talking about a separate
browser window instance, there is only one way to get data to it on the
client side (from the server side, of course, you can pass it from the
server-side code). When the JavaScript window.open method is called, it
returns a handle to the child window. This allow the "parent" document
access to the child. The child window's opener property contains a reference
to the window that opened it.

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
 
P

Phantom_skulcave via DotNetMonster.com

Hi Alexey. Thank you so much for writing in, especially as the method worked
like a charm.

Thank you, thank you. I can get a nice night's sleep again. :)

Alexey said:
Hi all. I know you'll probably laugh at this, but I can't get a simple child
browser to get the information from the parent browser.
[quoted text clipped - 10 lines]
Can someone please help? Thanks, all.

try to use window.opener.document.getElementById("id_here").value
 
P

Phantom_skulcave via DotNetMonster.com

Hi Kevin. I do mean using the window.open function and transferring the
string from the parent's textbox to the child's textbox.

I got a solution from Alexey though, so thanks for writing but you can
disregard the question now.

Thanks again.

Kevin said:
What do you mean by "child browser?" If you're talking about a separate
browser window instance, there is only one way to get data to it on the
client side (from the server side, of course, you can pass it from the
server-side code). When the JavaScript window.open method is called, it
returns a handle to the child window. This allow the "parent" document
access to the child. The child window's opener property contains a reference
to the window that opened it.
Hi all. I know you'll probably laugh at this, but I can't get a simple
child
[quoted text clipped - 11 lines]
Can someone please help? Thanks, all.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top