Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PostBack of Parent from Child

Posted on 2004-04-14
8
Medium Priority
?
720 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 7

Accepted Solution

by:
ramesh12 earned 2000 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
More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

 
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

Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Ready to get certified? Check out some courses that help you prepare for third-party exams.
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

661 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