Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 12th, 2006, 08:24 AM
Registered User
 
Join Date: May 2006
Location: , TN, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to acedanger Send a message via MSN to acedanger Send a message via Yahoo to acedanger
Default Refreshing "main" page from "pop up" window

I need some help with some javascript. From my main screen, I'm using a window.open() to open a popup window with a form and a submit button. What I want to happen is that when the user clicks the submit button, the popup window closes and the main page refreshes itself. I'm sure this is possible but I just don't know how to do it. Could someone help me out?

Reply With Quote
  #2 (permalink)  
Old May 12th, 2006, 08:32 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

In your popup use a standard button rather than a submit button and add a handler to its onclick attribute:
Code:
<input onclick="handleSubmit();" type="input" value="Submit">
Your handleSubmit function is:
Code:
function handleSubmit()
{
  document.forms[0].submit();
  self.opener.location.reload();
  self.close();
}
--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old May 12th, 2006, 08:44 AM
Registered User
 
Join Date: May 2006
Location: , TN, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to acedanger Send a message via MSN to acedanger Send a message via Yahoo to acedanger
Default

Joe, That worked. Thank you for your help.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Window refresh and window pop up in Java Script Aleksandra Javascript How-To 2 March 2nd, 2007 06:47 PM
Refreshing a page based on action in pop-up nkrust ASP.NET 1.0 and 1.1 Basics 4 January 15th, 2007 04:21 PM
Refreshing Property Window? Kaprice Visual Studio 2005 11 November 11th, 2006 08:49 PM
How to pass values to main page from Popup window rmanmeet ASP.NET 1.0 and 1.1 Basics 1 January 5th, 2006 01:44 PM
refreshing XML withour refreshing the page sasidhar79 XML 1 January 12th, 2005 05:16 AM



All times are GMT -4. The time now is 04:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.