Solved

PostBack of Parent from Child

Posted on 2004-04-14
8
704 Views
Last Modified: 2008-02-01
I have variable sent to parent form from child, then child closes, after which I need to post back the parent form...whats the best way of doing this?
0
Comment
Question by:gtvingo14
  • 4
  • 3
8 Comments
 
LVL 7

Accepted Solution

by:
ramesh12 earned 500 total points
ID: 10824716
<script type="text/javascript" language="javascript">

if (opener && !opener.closed) opener.location.reload(true);
self.close();

</script>

or

http://developer.irt.org/script/1705.htm
0
 
LVL 6

Author Comment

by:gtvingo14
ID: 10825509
where do you put this code at?
0
 
LVL 7

Expert Comment

by:ramesh12
ID: 10826254
In the child window
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
LVL 7

Expert Comment

by:ramesh12
ID: 10826284
Whenever you want your parent form to be refreshed like clickking on a close link


use like this

<script type="text/javascript" language="javascript">
function refreshParent()
{
if (opener && !opener.closed) opener.location.reload(true);
self.close();
}
</script>

<a href="javascript:refreshParent();">Close Me </a>
0
 
LVL 6

Author Comment

by:gtvingo14
ID: 10826365
this asks for me if i want to refresh the main window....i dont want it to ask me, just do it....

also, when it does...the pop up comes back
0
 
LVL 7

Expert Comment

by:ramesh12
ID: 10826484
Main form


<html>

<head>
<script language="JavaScript"><!--
var windowReference;

function openPopup() {
  windowReference = window.open('popup.htm','windowName');
  if (!windowReference.opener)
    windowReference.opener = self;
}
//--></script>
</head>

<body>

<form name="formName" onSubmit="alert('submit triggered')">
</form>

</body>

</html>




Child form

<form>
<input type="button" value="Submit" onClick="opener.document.formName.submit();window.close();">
</form>
0
 
LVL 6

Author Comment

by:gtvingo14
ID: 10826995
i cant get this to work either...

i have some vb code that is triggered by the button....Button html is below

<asp:button id="Button1" style="Z-INDEX: 131; LEFT: 392px; POSITION: absolute; TOP: 424px" runat="server" Height="24" Width="104px" Text="Deny Request" BackColor="LightCoral" BorderColor="LightCoral"></asp:button>
0
 
LVL 9

Expert Comment

by:pepsichris
ID: 10832975
If you've already got the rest working, then in the body tag of the child:

<body onunload="opener.document.yourform.submit();">

Change "yourform" to whatever you called your form in the parent.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
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?
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

735 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