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>")