Jump to content

Pop-up window open/close (new to js)


atl_andy

Recommended Posts

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.