atl_andy Posted December 6, 2007 Share Posted December 6, 2007 A simple form to select a project and enter a user id that opens in a new window. Now: once the user enters the desired project and clicks "Enter Assets", the audit form is opened in frame2. Goal: How do I get the audit form to open back in the parent window? (I'm following an example from a book, but want to get the concept down to add to a web app) Parent window: <html> <head> <title>Page Testing</title> <link href="style.css" type="text/css" rel="stylesheet" /> <script type="text/javascript"> function blankFrame() { return "<html><body></body></html>"; } var newWind; function openCenteredWindow(url) { var width = 200; var height = 200; var left = parseInt((screen.availWidth/3) - (width/3)); var top = parseInt((screen.availHeight/3) - (height/3)); var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + ",screenX=" + left + ",screenY=" + top; newWind = window.open("select-project.html", "subWind", windowFeatures); } </script> </head> <ul> <li><a href="" onclick="openCenteredWindow()">Enter New Project</a></li> </ul> </html> The pop-up window: <html> <head> <title>Select Project</title> <link href="style.css" type="text/css" rel="stylesheet" /> </head> <body> <p>Select Project:<input type="text" name="projectnumber" size="20" maxlength="40" value="" /></p> <p>Select User Name:<input type="text" name="userid" size="20" maxlength="40" value="" /></p> <a href="audit.html" target="frame2">Enter Assets</a> </body> </html> Quote Link to comment Share on other sites More sharing options...
atl_andy Posted December 6, 2007 Author Share Posted December 6, 2007 ...and close the pop-up window. Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 6, 2007 Share Posted December 6, 2007 are you wanting to re-display the form in the pop-up window; back in your parent window or are you wanting the form results or are you wanting to submit the form and destroy the pop-up? If your wanting to submit the form and destroy the pop-up: target the parent window and use window.close() onsubmit. Quote Link to comment Share on other sites More sharing options...
nogray Posted December 6, 2007 Share Posted December 6, 2007 window.opener is the parent window for pop-up window.close() wil close the pop-up window Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.