Solved

Javascript from child window to parent window

Posted on 2009-07-09
5
522 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
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…

706 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

19 Experts available now in Live!

Get 1:1 Help Now