Solved

Javascript from child window to parent window

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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

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…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

695 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