I use js to transfer values between parent and child mainly by calling the parent window method in the Child Window.
Parent.html
Html code
<! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">
<Html>
<Head>
<Title> parent.html </title>
<Meta http-equiv = "keywords" content = "keyword1, keyword2, keyword3">
<Meta http-equiv = "description" content = "this is my page">
<Meta http-equiv = "content-type" content = "text/html; charset = UTF-8">
<! -- <Link rel = "stylesheet" type = "text/css" href = "./styles.css"> -->
<Script type = "text/javascript">
Function openWin (){
Var style = "width = 300, height = 400, location = no, directories = no, toolbar = no, status = no, menubar = no, resizable = no, scrollbars = no ";
Window. open ("child.html", "open the window to pass values", style );
}
Function setValue (name, hname ){
Document. getElementById ("name"). value = name;
Document. getElementById ("hname"). value = hname;
}
</Script>
</Head>
<Body>
Name: <input type = "text" id = "name"/> <a href = "#" onclick = "openWin ()"> select </a>
<Input type = "hidden" name = "name" id = "hname"/>
</Body>
</Html>
Child.html
Html code
<! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">
<Html>
<Head>
<Title> child.html </title>
<Meta http-equiv = "keywords" content = "keyword1, keyword2, keyword3">
<Meta http-equiv = "description" content = "this is my page">
<Meta http-equiv = "content-type" content = "text/html; charset = UTF-8">
<! -- <Link rel = "stylesheet" type = "text/css" href = "./styles.css"> -->
<Script type = "text/javascript">
Function selectedThis (obj ){
Var name = obj. value;
Var hname = obj. id;
Window. opener. setValue (name, hname); // call the method of the parent window to pass the value
Window. opener = null;
Window. close ();
}
</Script>
</Head>
<Body>
Select a name: <br/>
<Input type = "radio" name = "name" id = "name1" value = "name 1" onclick = "selectedThis (this)"/> name 1
<Input type = "radio" name = "name" id = "name2" value = "name 2" onclick = "selectedThis (this)"/> name 2
<Input type = "radio" name = "name" id = "name3" value = "name 3" onclick = "selectedThis (this)"/> name 3
<Br/>
<Input type = "radio" name = "name" id = "name4" value = "name 4" onclick = "selectedThis (this)"/> name 4
<Input type = "radio" name = "name" id = "name5" value = "name 5" onclick = "selectedThis (this)"/> name 5
<Input type = "radio" name = "name" id = "name6" value = "name 6" onclick = "selectedThis (this)"/> name 6
</Body>
</Html>