Solved

Javascript from child window to parent window

Posted on 2009-07-09
5
525 Views
Last Modified: 2012-05-07
Dear Friend,

The below javascript working fine in IE7 but its not working in Firefox,
please have a look and revert where i am wrong.

what i am doing
i have a product page which contain the image field,
now i given a link which open a new window, which contain FileUpload control , a Upload Button and a Submit Button.

when user upload file successfully then he has to click on the submit button, on this the below javascript call and the parent page will refresh.

or is there any other way let me know
i am using it in asp.net.


function BackToParentPage()

{
 

window.opener.form1.submit();

window.close();
 

}

Open in new window

0
Comment
Question by:virafh
  • 2
  • 2
5 Comments
 
LVL 20

Accepted Solution

by:
ddayx10 earned 140 total points
ID: 24820997
window.opener.document.form1.submit();
0
 

Author Comment

by:virafh
ID: 24821490
no buddy its not working with firefox
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 110 total points
ID: 24821540
Yes buddy it should.
However only if you give it a NAME of form1
Alternative is

opener.document.forms[0].submit(); // submit the 0th (first) form on the page
0
 
LVL 20

Expert Comment

by:ddayx10
ID: 24828310
I tested that with both FF and IE and it works... if it's not working then something else is wrong. I could only evaluate the code you showed me.

Lets see the code that's opening the new window, as well as the form declaration, and the code you put in to replace what you had to postback the form.

I suspect you have a JS error that is causing the whole thing to stop before that line runs.

0
 

Author Closing Comment

by:virafh
ID: 31601961
Thank You
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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-…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now