title: How to close my popupwindow once the submit button click?
body: <p>i create a popupwindow which open 1 of my pages from my cakephp.
  This popup is a form which link to other page.
  Upon u click the 'Submit' button, it wil auto save the data to Mysql and close it.</p>
  
  <p>I would like to close the popup window once the click submit button.
  i set top.close(); but stil no function. </p>
  
  <p>What i mising..</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      function popup(mylink, windowname){
      if (! window.focus)return true;
          var href;
      if (typeof(mylink) == 'string')
          href=mylink;
      else
          href=mylink.href;
      window.open(href, windowname, 'width=800,height=1200,scrollbars=yes');
      return false;
      }
      &lt;/script&gt;   
      &lt;p&gt;&lt;A HREF="http://.../index.php/products/add" onClick="return popup(this, 'notes');top.close();"&gt;Add Products&lt;/A&gt;&lt;/p&gt;
  </code></pre>