recover variables in main page.

C

Chris

Hi,

I'm really begginer in javascript.

I created a form in a pop-up opened with javascript.
how to recover variables of the form in the main page.

Thanks for your help
Chris.
 
M

Mick White

Chris said:
Hi,

I'm really begginer in javascript.

I created a form in a pop-up opened with javascript.
how to recover variables of the form in the main page.

Thanks for your help
Chris.

opener.document.forms["formName"].elements["elementName"].value

Mick
 
M

Mick White

Robert said:
Chris said:
I created a form in a pop-up opened with javascript.
how to recover variables of the form in the main page.
Thanks for your help
Chris.
opener.document.forms["formName"].elements["elementName"].value

Mick
begin = location.search.indexOf("data=");
if (begin >0 ){
theData = location.search.substring(begin+5,location.search.length);
theData = unescape(theData);
document.write("<p>Here is the passed data:</p>");
document.write(theData + "<\/p>");
}
else
{
document.write("Could not find passed"
+ " variable \"data=\" with escaped data.")

This is one way to accomplish your goals, I just want to point out
that all main page variables, functions and methods are available to the
pop-up without using a query string.


var theData =
opener.document.forms["formName"].elements["elementName"].value

document.write (theData?"<p>Here is the passed data:
"+theData+"</p>":"<p>No data</p>")
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top