Solved

Javascript from child window to parent window

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

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

789 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