Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

post value from child to parent

Posted on 2006-03-31
5
Medium Priority
?
272 Views
Last Modified: 2012-06-22
Hi All,
If any one can help me to create a javascript for:

I have a parent window and a child window.
when i put some value in child window(having form action=" parent file")
and
click on submit button then
pop-up window(child window) should closed
and
the posted values should be in parent form. so that when i refresh parent page values remained there.
0
Comment
Question by:topdeveloper1
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
bubbledragon earned 2000 total points
ID: 16348628
On you parent page
<form name="received" method="post" action="#"></form>

On your child page
<script>
function PassToParent(obj) {
      opener.document.getElementById('received').innerHTML = obj;
      opener.document.getElementById('received').submit();
}
</script>

<form name="child">
<input type="textbox" name="ABC" value="ABC">
<input type="button" value="submit" onClick="PassToParent(this.form.innerHTML);self.close();">
</form>
0
 
LVL 7

Expert Comment

by:moseack
ID: 16350000
Browsers are not required to save the state (form information - or anything set in JavaScript) pages when asking for a refresh.
A nice feature of better browsers is, when a page was loaded by a "post" method, when asking for "refresh" the browser will ask you if to resubmit the "post" data.
Plus if the page was created with a "get" with parameters in the URL query, any refresh will include the state.
0
 
LVL 7

Expert Comment

by:moseack
ID: 16618714
No objection here.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Suggested Courses

578 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