Solved

Javascript from child window to parent window

Posted on 2009-07-09
5
530 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
[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
  • 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

730 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